137
MEDICINE DISTRIBUTION Management SYSTEM A Project work submitted to the ISLAMIA UNIVERSITY BAHAWALPUR SubCampus RahimYarKhan Department Of Computer Science Submitted by: Nadia Munawar(Reg No:) BSCS(Final Year) Guided by:

Medicine distribution system

Embed Size (px)

DESCRIPTION

final year documentation

Citation preview

Page 1: Medicine distribution system

MEDICINE DISTRIBUTION Management SYSTEM

A Project work submitted to the

ISLAMIA UNIVERSITY BAHAWALPUR

SubCampus RahimYarKhan

Department Of Computer Science

Submitted by

Nadia Munawar(Reg No)

BSCS(Final Year)

Guided by

Sir Zahid Aslam (Head of the Department)

Sir Zafar Iqbal

IUB

ISLAMIA UNIVERSITY BAHAWALPUR

SubCampus RahimYarKhan

IUB

ISLAMIA UNIVERSITY BAHAWALPUR

SubCampus RahimYarKhan

BONAFIDE CERTIFICATE

Certified that the project work entitled ldquoMEDICINE DISTRIBUTION SYSTEMrdquo submitted by NADIA MUNAWAR( Reg No ) To the Department of Computer Science under the guidance Of Sir Zafar Iqbal in partial fulfillment of the requirements for the Under Graduate degree in Bachelor of Computer Scince

Sir Zafar Iqbal Sir Zahid AslamPROJECT GUIDE HEAD OF THE DEPARTMENT

Submitted for viva voice examination held on __________

INTERNAL EXAMINER EXTERNAL EXAMINER

IUB

ISLAMIA UNIVERSITY BAHAWALPUR

SubCampus RahimYarKhan

DECLARATION

We hereby declare that this work was carried out by me under theguidance and Supervision of Sir Zahid Aslam(HOD) and Sir Zafar IqbalThe period of project work is From November 2014 To April 2014 This project work is submitted to Islamia University Bahawalpur Sub Campus Rahim Yar Khan Department of Computer Science in partial fulfillment for the requirement of Degree in Bachelor of Computer Science

I declare that this work has not been submitted any where else forthe award of any other degree

NADIA MUNAWAR

ACKNOWLEDGEMENT

First of all I would like to express my heartful thanks to rdquo The Almighty Godrdquo for this opportunity which he rendered to me and gives the physical strength and pleasant mind to complete this project work

I would thank our honorable Director for his inspiration And we thank Sir Zahid Aslam our Head of the Department and also Sir Zafar Iqbal for the correct guidance and advice

We also thank our department staffMadam GulSir Tariq SaeedSir Adeel Abid Sir Shehzad Sir Rizwan Sir Mujahid

who all encourage and satisfy my needs to finish this project work

I am very happy to thank our lab co-ordinator lab assistants forgiving a well equipped lab for developing this project work

I extent our thanks and gratitude to our parents Friends and those who helped me directly and indirectly for the successful completion of this project work

CONTENTS

SNo Contents

1 Introduction 1110232 Purpose 1110232 Scope 1110232 Goal

2 Problem Definition OR Project Objective

3 System Specification 1110232 System Configuration 1110232 Software Specification

4 System Analysis 1110232 Existing System 1110232 Proposed System

5 System Design OR Detailed Design 1110232 Design Principles 1110232 Input Design 1110232 Output Design

6 Database Design 7 Dataflow Diagram 8 Data Dictionary

9 System Testing

10 Sample Coding

11 Screenshots 12 Bibliography

INTRODUCTION

Introduction

Medicine Distribution System software is general software developed

for Medical Store and agencies This software help them to do billing

ledgers accounts and stock maintenance

Purpose

The purpose of this document is to specify requirements and to give

guidelines for the development of above said project In particular it

gives guidelines on how to prepare the above said project

Scope

As this is generic software it can be used by a wide variety of outlets

(Retailers and Wholesalers) to automate the process of manually

maintaining the records related to the subject of maintaining the stock

ledgers accounts and cash flows

Goal

The main goal of the application is to maintain the records of purchase

Sales and stock details accounts with cash transaction maintenance

Medicine Distribution System software is very needy for Medical Store

and Agencies This software helps them maintain day to day transactions

in computer

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 2: Medicine distribution system

IUB

ISLAMIA UNIVERSITY BAHAWALPUR

SubCampus RahimYarKhan

BONAFIDE CERTIFICATE

Certified that the project work entitled ldquoMEDICINE DISTRIBUTION SYSTEMrdquo submitted by NADIA MUNAWAR( Reg No ) To the Department of Computer Science under the guidance Of Sir Zafar Iqbal in partial fulfillment of the requirements for the Under Graduate degree in Bachelor of Computer Scince

Sir Zafar Iqbal Sir Zahid AslamPROJECT GUIDE HEAD OF THE DEPARTMENT

Submitted for viva voice examination held on __________

INTERNAL EXAMINER EXTERNAL EXAMINER

IUB

ISLAMIA UNIVERSITY BAHAWALPUR

SubCampus RahimYarKhan

DECLARATION

We hereby declare that this work was carried out by me under theguidance and Supervision of Sir Zahid Aslam(HOD) and Sir Zafar IqbalThe period of project work is From November 2014 To April 2014 This project work is submitted to Islamia University Bahawalpur Sub Campus Rahim Yar Khan Department of Computer Science in partial fulfillment for the requirement of Degree in Bachelor of Computer Science

I declare that this work has not been submitted any where else forthe award of any other degree

NADIA MUNAWAR

ACKNOWLEDGEMENT

First of all I would like to express my heartful thanks to rdquo The Almighty Godrdquo for this opportunity which he rendered to me and gives the physical strength and pleasant mind to complete this project work

I would thank our honorable Director for his inspiration And we thank Sir Zahid Aslam our Head of the Department and also Sir Zafar Iqbal for the correct guidance and advice

We also thank our department staffMadam GulSir Tariq SaeedSir Adeel Abid Sir Shehzad Sir Rizwan Sir Mujahid

who all encourage and satisfy my needs to finish this project work

I am very happy to thank our lab co-ordinator lab assistants forgiving a well equipped lab for developing this project work

I extent our thanks and gratitude to our parents Friends and those who helped me directly and indirectly for the successful completion of this project work

CONTENTS

SNo Contents

1 Introduction 1110232 Purpose 1110232 Scope 1110232 Goal

2 Problem Definition OR Project Objective

3 System Specification 1110232 System Configuration 1110232 Software Specification

4 System Analysis 1110232 Existing System 1110232 Proposed System

5 System Design OR Detailed Design 1110232 Design Principles 1110232 Input Design 1110232 Output Design

6 Database Design 7 Dataflow Diagram 8 Data Dictionary

9 System Testing

10 Sample Coding

11 Screenshots 12 Bibliography

INTRODUCTION

Introduction

Medicine Distribution System software is general software developed

for Medical Store and agencies This software help them to do billing

ledgers accounts and stock maintenance

Purpose

The purpose of this document is to specify requirements and to give

guidelines for the development of above said project In particular it

gives guidelines on how to prepare the above said project

Scope

As this is generic software it can be used by a wide variety of outlets

(Retailers and Wholesalers) to automate the process of manually

maintaining the records related to the subject of maintaining the stock

ledgers accounts and cash flows

Goal

The main goal of the application is to maintain the records of purchase

Sales and stock details accounts with cash transaction maintenance

Medicine Distribution System software is very needy for Medical Store

and Agencies This software helps them maintain day to day transactions

in computer

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 3: Medicine distribution system

IUB

ISLAMIA UNIVERSITY BAHAWALPUR

SubCampus RahimYarKhan

DECLARATION

We hereby declare that this work was carried out by me under theguidance and Supervision of Sir Zahid Aslam(HOD) and Sir Zafar IqbalThe period of project work is From November 2014 To April 2014 This project work is submitted to Islamia University Bahawalpur Sub Campus Rahim Yar Khan Department of Computer Science in partial fulfillment for the requirement of Degree in Bachelor of Computer Science

I declare that this work has not been submitted any where else forthe award of any other degree

NADIA MUNAWAR

ACKNOWLEDGEMENT

First of all I would like to express my heartful thanks to rdquo The Almighty Godrdquo for this opportunity which he rendered to me and gives the physical strength and pleasant mind to complete this project work

I would thank our honorable Director for his inspiration And we thank Sir Zahid Aslam our Head of the Department and also Sir Zafar Iqbal for the correct guidance and advice

We also thank our department staffMadam GulSir Tariq SaeedSir Adeel Abid Sir Shehzad Sir Rizwan Sir Mujahid

who all encourage and satisfy my needs to finish this project work

I am very happy to thank our lab co-ordinator lab assistants forgiving a well equipped lab for developing this project work

I extent our thanks and gratitude to our parents Friends and those who helped me directly and indirectly for the successful completion of this project work

CONTENTS

SNo Contents

1 Introduction 1110232 Purpose 1110232 Scope 1110232 Goal

2 Problem Definition OR Project Objective

3 System Specification 1110232 System Configuration 1110232 Software Specification

4 System Analysis 1110232 Existing System 1110232 Proposed System

5 System Design OR Detailed Design 1110232 Design Principles 1110232 Input Design 1110232 Output Design

6 Database Design 7 Dataflow Diagram 8 Data Dictionary

9 System Testing

10 Sample Coding

11 Screenshots 12 Bibliography

INTRODUCTION

Introduction

Medicine Distribution System software is general software developed

for Medical Store and agencies This software help them to do billing

ledgers accounts and stock maintenance

Purpose

The purpose of this document is to specify requirements and to give

guidelines for the development of above said project In particular it

gives guidelines on how to prepare the above said project

Scope

As this is generic software it can be used by a wide variety of outlets

(Retailers and Wholesalers) to automate the process of manually

maintaining the records related to the subject of maintaining the stock

ledgers accounts and cash flows

Goal

The main goal of the application is to maintain the records of purchase

Sales and stock details accounts with cash transaction maintenance

Medicine Distribution System software is very needy for Medical Store

and Agencies This software helps them maintain day to day transactions

in computer

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 4: Medicine distribution system

ACKNOWLEDGEMENT

First of all I would like to express my heartful thanks to rdquo The Almighty Godrdquo for this opportunity which he rendered to me and gives the physical strength and pleasant mind to complete this project work

I would thank our honorable Director for his inspiration And we thank Sir Zahid Aslam our Head of the Department and also Sir Zafar Iqbal for the correct guidance and advice

We also thank our department staffMadam GulSir Tariq SaeedSir Adeel Abid Sir Shehzad Sir Rizwan Sir Mujahid

who all encourage and satisfy my needs to finish this project work

I am very happy to thank our lab co-ordinator lab assistants forgiving a well equipped lab for developing this project work

I extent our thanks and gratitude to our parents Friends and those who helped me directly and indirectly for the successful completion of this project work

CONTENTS

SNo Contents

1 Introduction 1110232 Purpose 1110232 Scope 1110232 Goal

2 Problem Definition OR Project Objective

3 System Specification 1110232 System Configuration 1110232 Software Specification

4 System Analysis 1110232 Existing System 1110232 Proposed System

5 System Design OR Detailed Design 1110232 Design Principles 1110232 Input Design 1110232 Output Design

6 Database Design 7 Dataflow Diagram 8 Data Dictionary

9 System Testing

10 Sample Coding

11 Screenshots 12 Bibliography

INTRODUCTION

Introduction

Medicine Distribution System software is general software developed

for Medical Store and agencies This software help them to do billing

ledgers accounts and stock maintenance

Purpose

The purpose of this document is to specify requirements and to give

guidelines for the development of above said project In particular it

gives guidelines on how to prepare the above said project

Scope

As this is generic software it can be used by a wide variety of outlets

(Retailers and Wholesalers) to automate the process of manually

maintaining the records related to the subject of maintaining the stock

ledgers accounts and cash flows

Goal

The main goal of the application is to maintain the records of purchase

Sales and stock details accounts with cash transaction maintenance

Medicine Distribution System software is very needy for Medical Store

and Agencies This software helps them maintain day to day transactions

in computer

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 5: Medicine distribution system

SNo Contents

1 Introduction 1110232 Purpose 1110232 Scope 1110232 Goal

2 Problem Definition OR Project Objective

3 System Specification 1110232 System Configuration 1110232 Software Specification

4 System Analysis 1110232 Existing System 1110232 Proposed System

5 System Design OR Detailed Design 1110232 Design Principles 1110232 Input Design 1110232 Output Design

6 Database Design 7 Dataflow Diagram 8 Data Dictionary

9 System Testing

10 Sample Coding

11 Screenshots 12 Bibliography

INTRODUCTION

Introduction

Medicine Distribution System software is general software developed

for Medical Store and agencies This software help them to do billing

ledgers accounts and stock maintenance

Purpose

The purpose of this document is to specify requirements and to give

guidelines for the development of above said project In particular it

gives guidelines on how to prepare the above said project

Scope

As this is generic software it can be used by a wide variety of outlets

(Retailers and Wholesalers) to automate the process of manually

maintaining the records related to the subject of maintaining the stock

ledgers accounts and cash flows

Goal

The main goal of the application is to maintain the records of purchase

Sales and stock details accounts with cash transaction maintenance

Medicine Distribution System software is very needy for Medical Store

and Agencies This software helps them maintain day to day transactions

in computer

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 6: Medicine distribution system

INTRODUCTION

Introduction

Medicine Distribution System software is general software developed

for Medical Store and agencies This software help them to do billing

ledgers accounts and stock maintenance

Purpose

The purpose of this document is to specify requirements and to give

guidelines for the development of above said project In particular it

gives guidelines on how to prepare the above said project

Scope

As this is generic software it can be used by a wide variety of outlets

(Retailers and Wholesalers) to automate the process of manually

maintaining the records related to the subject of maintaining the stock

ledgers accounts and cash flows

Goal

The main goal of the application is to maintain the records of purchase

Sales and stock details accounts with cash transaction maintenance

Medicine Distribution System software is very needy for Medical Store

and Agencies This software helps them maintain day to day transactions

in computer

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 7: Medicine distribution system

Medicine Distribution System software is general software developed

for Medical Store and agencies This software help them to do billing

ledgers accounts and stock maintenance

Purpose

The purpose of this document is to specify requirements and to give

guidelines for the development of above said project In particular it

gives guidelines on how to prepare the above said project

Scope

As this is generic software it can be used by a wide variety of outlets

(Retailers and Wholesalers) to automate the process of manually

maintaining the records related to the subject of maintaining the stock

ledgers accounts and cash flows

Goal

The main goal of the application is to maintain the records of purchase

Sales and stock details accounts with cash transaction maintenance

Medicine Distribution System software is very needy for Medical Store

and Agencies This software helps them maintain day to day transactions

in computer

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 8: Medicine distribution system

PROBLEM DEFINITION

OR

PROJECT OBJECTIVE

Medicine Distribution System is very helpful to manage ledgers information accounts of Medical Store and Agencies It can easily keep the record of Hospitals who done regular business deals

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 9: Medicine distribution system

This software is comprehensiveness and the simple by which it handles complex tasks easily

Medicine Distribution System project covers important details required for designing medical software application

Main objective of this project is to develop a software application for medical shops and Agencies for performing tasks like billing managing ledgerrsquos details manage Accounts and organizing stock details

This Medicine Distribution System project is implemented in CNet programming language

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 10: Medicine distribution system

SYSTEM SPECIFICATION

SYSTEM CONFIGURATION

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 11: Medicine distribution system

HARDWARE REQUIREMENTS

Processor Intel Pentium OR Higher

Memory-RAM 512 MB or higher RAM

Memory-CACHE 128 MB or higher RAM

Hard Disk 40GB or higher

SOFTWARE REQUIREMENTS

LANGUAGE C SHARP

BACKEND SQL SERVER-2005

FRONT END VISUAL STUDIO 2010

OPERATING SYSTEM WINDOWS XP amp HIGHER VERSION

SOFTWARE SPECIFICATION

VISUAL STUDIO NET

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 12: Medicine distribution system

Visual Studio NET is a complete set of development tools for building

1110232 ASP Web applications1110232 XML Web services1110232 Desktop applications1110232 Mobile applications

Visual Basic NET Visual C++ NET and Visual C NET all use the same integrated development environment (IDE) which allows them to share tools and facilitates in the creation of mixed-language solutions

CVisual C pronounced C sharp is a new object-oriented programming language that is an evolution of C and C++ providing a simple and type-safe language for developing applications

Types of forms used in NetWeb FormsWeb Forms are an ASPNET technology that you use to create programmable Web pages Web Forms render themselves as browser compatible HTML and script which allows any browser on any platform to view the pages Using Web Forms you create Web pages by dragging and dropping controls onto the designer and then adding code similar to the way that you create Visual Basic forms

Windows FormsWindows Forms is the new platform for Microsoft Windows application development based on the NET Framework This framework provides a clearobject-oriented extensible set of classes that enables you to develop richWindows applications Additionally Windows Forms can act as the local userinterface in a multi-tier distributed solution

The NET Framework

OverviewThe NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 13: Medicine distribution system

The NET Framework is designed to fulfill the following objectives

To provide a consistent object-oriented programming environment whether object code is stored and executed locally executed locally but Internet-distributed or executed remotely

To provide a code-execution environment that minimizes software deployment and versioning conflicts

To provide a code-execution environment that guarantees safe execution of code including code created by an unknown or semi-trusted third party

To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments

To make the developer experience consistent across widely varying types of applications such as Windows-based applications and Web-based applications

To build all communication on industry standards to ensure that code based on the NET Framework can integrate with any other code The NET Framework is a multi-language environment for building deploying and running XML Web services and applications

1110232 Common Language Runtime Despite its name the runtime actually has a role in both a components runtime and development time experiences While the component is running the runtime is responsible for managing memory allocation starting up and stopping threads andprocesses and enforcing security policy as well as satisfying any dependencies that the component might have on other components At development time the runtimes role changes slightly because it automates so much (for example memory management) the runtime makes the developers experience very simple especially when compared to COM as it is today In particular features such as reflection dramatically reduce the amount of code a developer must write in order to reflection dramatically reduce the amount of code a developer must write in order to turn business logic into a reusable component

1110232 Unified programming classes The framework provides developers with a unified object-oriented hierarchical and extensible set of class libraries (APIs) Currently C++ developers use the

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 14: Medicine distribution system

Microsoft Foundation Classes and Java developers use the Windows Foundation Classes The framework unifies these disparate models and gives Visual Basic andJScript programmerrsquos access to class libraries as well By creating a common set of APIs across all programming languages the common language runtime enables cross-language inheritance error handling and debugging All programming languages from JScript to C++ have similar access to the framework and developers are free to choose the language that they want to use

DebuggingVisual Studio NET provides a single integrated debugger for all Visual Studio languages including Visual Basic and C A new unified interface combines features of the Visual C++ and Visual Basic 60 debuggers as well as many new features

1110232 Cross-Language DebuggingUsing the integrated debugger you can debug projects that are part of the same solution but are written in different languages For example you can debug a solution that contains a project consisting of a Visual Basic or Visual C user interface application and a Visual C++ server application and you can step back and forth between these projects for example from Managed Extensions for C++ to Visual Basic and back to Managed Extensions for C++

1110232 Attaching to a Running ProgramYou can attach the debugger to a program that is already running and debug the program Attaching to a running program works the same way whether the program is running on a host machine or a remote machine The program does not need to be launched in the Visual Studio NET integrated development environment (IDE)

1110232 Remote DebuggingYou can attach to and debug a process that is running on a different computer from the one on which you are running Visual Studio For example if you are debugging a Windows Forms client application and an XML Web service it uses you can run Visual Studio on the client and then attach to the server that is providing the XML Web service You typically perform this kind of debugging for Web Forms projects

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 15: Medicine distribution system

1110232 Debugging Multithreaded ApplicationsNew for Visual Basic users is the ability to write and debug multithreadedapplications The Threads window can be used to view the threads that are running and to switch context

1110232 Debugging Multiple ProgramsYou can debug multiple programs by attaching to running programs or bylaunching multiple programs from the Visual Studio IDE

1110232 NET Framework Classes for Debugging and Code TracingYou can include instrumentation code in your Microsoft NET application Several NET Framework classes are available for use both in debugging and in instrumenting your code

Visual BasicNet

New in Visual Basic

Web Development Visual Basic and C include support for Web Forms and XML Web services Web Forms allow you to easily and quickly create the browser-based interface for ASPNET Web applications XML Web services allow you to package a Visual Basic or C method and make it accessible on the Web

Windows Forms and Controls You can use Windows Forms and controls to create the presentation layer of a distributed application Windows Forms provides a clear object-oriented extensible set of classes that enable you to develop rich Windows applicationsNew in Debugging You can now debug projects that are part of the same solution but written in different languages perform remote debuggingand implement trace functionality throughout your code to retrieve finely tuned output

SQL SERVERSQL SERVERSQL server is a clientserver relational database management system (RDBMS) that uses transact-SQL to send request between a client and SQL server

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 16: Medicine distribution system

Clientserver ArchitectureSQL server is designed to be a clientserver system Clientserver systems are constructed so that the database can reside on a central computer know as a server and be shared among several users When users want to access the date in SQL server they run an application on their local computer know as a client that connects over a network to the server running SQL serverSQL server can work with thousands of client applications simultaneously The server has features to prevent the logical problems that occur if a user tries to read or modify data currently being used by others While SQL server is designed to work as a server in a clientserver network It also capable of working as a stand-alone database directly on the client The scalability and ease-of-use features of SQL server allow it to work efficiently on a client without consuming too many resources SQL server efficiently allocates the available resources such as memory network bandwidth and disk IO among the multiple users

1110232 Codersquos 12 rules are satisfied That isData RepresentationRule of guaranteed accessProper treatment of null valueSecurityVersioningPhysical IndependenceLogical IndependenceIntegrity constraint independenceView UpdatingData DescriptionComprehensive data sub languageInsert and update ruleDistribution

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 17: Medicine distribution system

SYSTEM ANALYSIS

System Analysis

System analysis is the first and foremost step performed in developing the software to solve a particular problem In the analysis part a software developer examines the requirements Carrying out preliminary investigation identifies these requirements

At the conclusion of analysis there is system description and a set of requirements for a new system If there is no existing system the analysis defines only the requirements

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 18: Medicine distribution system

Analysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staffAnalysts must spend considerable time in examining components of existing system Analysts have to find out what information is send between the end-users and the staff

One of the most important factors in system analysis is to understand the system and its problems A good understanding of the system enables designers to identify and correct problems and suggest realistic solutions for them It also helps them to develop solutions that satisfy all users and thus make the new system acceptable in an organization System users are the first information source investigated by the analysts

From users it is to find out the existing system activities and to develop the userrsquos objectives and requirements A system analyst must spend a lot of time talking to users and finding how they use the system any problems they find with the system and what they expect from itThus a rule system analysis is a difficult but rewarding job There are many constraints to be compiled within this work and many people to satisfy But there is the reward of seeing of a new system does its job perfectly

Analysis consists of two sub phases1110232 Planning1110232Requirement definition

During planning phase cost estimates and work schedules will be plannedRequirement definition is a specification that describes the processing environment the required software functions performance constraints (size speed machine configuration) and exception handling

EXISTING SYSTEM

The existing system uses manual transaction processing

DrawbacksLarge amount of clerical time is required

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 19: Medicine distribution system

The record maintainability is difficultAccessibility of accurate information from the past record is difficultThere is always delay in information search and retrieval It requiresmany people to carry out a single problemLot of human resources is requiredData reliability and maintainability is difficultLot amount of records need much place to saveThe paper works have to be taken careCannot be maintaining manual record for long time

PROPOSED SYSTEM

The proposed system has been designed to overcome all the drawbacks found in the existing system The new system has been proposed to use VISUAL BASICNET as front end and SQL SERVER as backend The proposed system has enhanced features which was not found in the existing system The salient features areSecurity for the data is done easilyValidation is done to enter correct dataMemory consumption is very less and the processing speeds fastData reports are presented in a neat formatIt is apt for this modern world

It is easy to combine the database of other software and to view then records in the files and also it is easy to get the reports by giving input data

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 20: Medicine distribution system

SYSTEM DESIGN OR DETAILED DESIGN

Design is the first step in the development phase for any engineering product (or) system It may be defined as

ldquothe process of applying various techniques and principles for the purpose of defining a device a process or a system insufficient detail to permit its physical realizationrdquo

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 21: Medicine distribution system

Software design is an iterative process through which requirements are translated into a bdquoBlue print‟ for constructing the software The design is represented at a high level of abstraction a level that can be directly translated to specific data functional and behavioral requirements

Preliminary Design is concerned with the transformation of requirements into a data and software architecture

Detail Design focuses on refinements to the architectural representation That leads to detailed data structure and algorithmic representation for software

The Data Design transforms the information domain model created during analysis into the data structures that will be required to implement software

The Architectural Design defines the relationship among major structural elements of the program

The Interface Design describes how the software communicates within itself to systems that interoperate with it and with humans who use it An interface implies a flow of information (eg data andor control) Thereforethe data and control flow diagrams provide the information required for interface design

The design process of software system has two levels 1 Systems Design or Top Level Design 2 Detailed Design or Logical Design

SYSTEM DESIGN

System Design or Top Level Design

THE SYSTEM DESIGN PROCESSSystem design develops the architectural detail required to build a system or product In the system design the focus is on deciding which modules are needed for the system the specification of these modules and how these modules should be interconnected

The system design process encompasses the following activities

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 22: Medicine distribution system

bull Partition the analysis model into subsystemsbull Identify concurrency that is dictated by the problembull Allocate subsystems to processors and tasksbull Develop a design for the user interfacebull Choose a basic strategy for implementing data managementbull Identify global resources and the control mechanisms required to access thembull Design an appropriate control mechanism for the system including task managementbull Consider how boundary conditions should be handledbull Review and consider trade-offs

DETAILED DESIGN

Detailed Design or Logical Design In detailed design the interconnection of the modules or how the specifications of the modules can be satisfied is decided

Some properties for a software system design are

Verifiability Completeness Consistency Traceability Simplicityunderstandability

Design Principles Basic design principles that enable the software engineer to navigate the design process are

The design process should not suffer from ldquoTunnel visionrdquo The design should be traceable to the analysis model The design should not reinvent the wheel The design should minimize the intellectual distance between thesoftware

and the problem as it exists in the real world The design should exhibit uniformity and integrity The design should be structured to accommodate changes The design is not coding the coding is not a design The design should be assessed for the quality as it is beingcreated not after

the fact

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 23: Medicine distribution system

The design should be reviewed to minimize the conceptual errors

Input designInput design is a part of overall system design requires the very careful analysis of the input data items The goal of the input design is to make the data entry easier logical and free from errors The user controls input data The commonly used input output devices are mouse keyboard and the visual display unit The well designed well organized screen formats are used to acquire the inputs The data accepted is stored on database fileOur system is classified into subsystem such as1110183 Purchase Detailrsquos1110183 Sale Detailrsquos1110183 Stock maintenance1110183 Product Details1110183 Account Details1110183 Ledgerrsquos1110183 Data Report

Output Design

Output is the most important and direct source of information the user Efficient amp intelligent output design improves the system relationships with the users and helps in decision-making The output is collected in order to help the user to make a wise decision

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 24: Medicine distribution system

DATABASE DESIGN

DATABASE DESIGNThe goal of Database Design is to generate a set of relation schemes that allow us to store information without unnecessary redundancy and allows us to retrieve information easily We can achieve optimization ease of use in maintenance by designing the database using relational model in which data is stored in the form of tables and there exists a relation between or among the tables The design objectives must be

To reduce redundancy To arrive at loss-less join To reduce the time as compared to the present system To reduce the number of errors

NORMALIZATIONNormalization of relation schema is done to eliminate insertion and deletion anomalies that exist in databases Normalization is a step-by-step reversible process of converting given collection of relations to some more desirable form in which the relations have a progressively simpler and more regular structure No information is lost in normalization process

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 25: Medicine distribution system

The objectives of Normalization are To make it feasible to represent any relation in the database To obtain powerful retrieval algorithms based on a simpler collection of

relational operations than would otherwise be necessary To free relations from undesirable insertions update and deletion

dependencies To make the collection of relations neutral to query statistics where these

statistics are liable to change as time goes by

A relation R is said to be in 1NF if all underlying domains contain atomic values only A relation R is said to be in 2NF if and only if it is in 1NFand every non-key attribute is non-transitively dependent on the primary key A relationship is said to be in 3NF if and only if it does not feature any non-trivial functional dependencies between non-prime attributes A non-prime attribute is one that does not belong to any candidate key

DATA FLOW DIAGRAM

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 26: Medicine distribution system

DATA FLOW DIAGRAM

Data Flow Diagram (DFD) is a design tool constructed to show how data within the system It is designed from the data which is collected during data collection phase DFD is otherwise called as ldquoBubble Chartrdquo

A level 0 DFD also called as the context diagram represent the entire system as a single module with input and output data indicating by incoming and outgoing arrows respectively Additional process and information flow paths are represented as the level 0 DFD is partitioned to reveal more details A level 1 DFD also called as top level DFD represent the system with major modules and data stores The other levels will show each module in top level DFD in a more detailed fashion

There are five symbol used in DFD They are Rectangle Open Rectangle Circle arrow small circle Each one has its own meaning

DATA FLOW Data move in a specific direction from an origin to destination

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 27: Medicine distribution system

PROCESS People procedure or device that produce data

SOURCE or DESTINATION External sources or destinations of datawhich may be people organization or others

DATA STORAGE

Data referred by process in the system

CONTROL FLOW

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 28: Medicine distribution system

DATA DICTIONARY

DATA DICTIONARY

A data dictionary is a catalog a repository of the elements in the system As the name suggests these elements center on data and the way they are structured to

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 29: Medicine distribution system

meet user requirements and organization needs A data dictionary is a collection of data about data The basic idea is to provide information on the definition structure and the user of the element an organization uses The data element is a unit of data that can‟t be decomposed

PROVINCE

DISTRICT

SUB AREA

STORE

COMPANY

CATEGORY

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 30: Medicine distribution system

MEASURING UNIT

PRODUCT

ACCOUNT BASIC TYPE

ACCOUNT LEADGER TYPE

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 31: Medicine distribution system

ACCOUNT LEADGER

ACCOUNT HEAD

ORDER DETAIL

ORDER

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 32: Medicine distribution system

MAIN PURCHASE

DETAIL PURCHASE

MAIN SALE

DETAIL SALE

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 33: Medicine distribution system

MAIN VOUCHER

DETAIL VOUCHER

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 34: Medicine distribution system

SYSTEM TESTING

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 35: Medicine distribution system

System Testing

System Testing is an important stage in any system development life cycle Testing is a process of executing a program with the intention of finding errors The importance of software testing and its implications with respect to software quality cannot be overemphasized Software testing is a critical element of software quality assurance and represents the ultimate review of specification design and coding A good test case is one that has a high probability of finding a yet undiscovered error

Testing is the set of activities that can be planned in advance and conducted systematically Different test conditions should be thoroughly checked and the bugs detected should be fixed The testing strategies formed by the user are performed to prove that the software is free and clear from errors To do this there are many ways of testing the systemrsquos reliability completeness and maintainability

Testing is a process of executing a program with the intent of finding an error A good test case is one that has a high probability of finding a yet undiscovered error A successful test is one that uncovers an as yet undiscovered error

TESTING STRATEGIES

Testing is a set of activities that can be planned in advance and conducted systematically A strategy for software testing must accommodate low-level tests that are necessary to verify that a small source code segment has been correctly

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 36: Medicine distribution system

implemented as well as high-level tests that validate system functions against customer requirementsSoftware testing is none element of verification and validationVerification refers to the set of activities that ensure that software correctly implements a specific function Validation refers to a different set of activities that ensure that the software has been built is traceable to customer requirements

Unit TestingUnit testing focuses verification effort on the smallest unit of software design Using the procedural design description important control paths are tested to uncover errors within the boundary of the module The relative complexity of test and uncovered errors is limited by the constrained scope established for unit testing The unit test is normally white box oriented and the step can be conducted in parallel for multiple modules

The module interface is tested to ensure that information properly flows into and out of the program unit under test The local data structure is examined to ensure that data stored temporarily maintains its integrity during all steps in an algorithmrsquos execution

Boundary conditions are tested to ensure that the module operates properly at boundaries established to limit or restrict processing All independent paths through the control structure are exercised to ensure that all statements in a module have been executed at least once And finally all error-handling paths are tested

Integration TestingIntegration testing is a systematic technique for constructing the program structure while conducting test to uncover errors associate with interfacing Objectives are used to take unit test modules and built program structure that has been directed by design

Integration testing is a systematic technique for constructing the program structure while conducting tests to uncover errors associated with interfacing The objective is to take unit tested modules and build a program structure that has been dictated by design There is often a tendency to attempt non-incremental integration to construct the program using a big bang approach All modules are combined in advance The entire program is tested as a whole

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 37: Medicine distribution system

Incremental integration is the anti thesis of big bang approach The program is constructed and tested in small segments where errors are easier to isolate and correct interfaces are more likely to be tested completely and systematic test applied Modules are integrated by moving downward through the control hierarchy beginning with the main control module

Validation TestingValidation testing can be defined in many ways but a simple definition is that can be reasonably expected by the customer After validation test has been conducted one of two possible conditions exists1110183The functions or performance characteristics confirm to specification and are accepted1110183A deviation from specification is uncovered and a deficiency list is created

Proposed system under consideration has been tested by using validation testing and found to be working satisfactorily

White Box Testing

White-box tests focus on the program control structures Test casesare derived to ensure that all statement in the program has been executed at least once during testing and that all logical conditions have been exercised Knowing the internal working of a product tests can be conducted to ensure that ldquoall gears meshrdquo that is the internal operation performs according to specification and all internal components have been adequately exercised

White Box Testing is a test case design methods that uses the control structure of the procedural design to design to derive test cases Using white box testing methods the test cases should

Guarantee that all independent paths within a module have been exercised at least once

Exercise all logical decision on their and false sides Execute all loops at their boundaries and within their operational bounds Exercise internal data structures to ensure their validity

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 38: Medicine distribution system

Black Box Testing

Black-box testing focuses on the functional requirements of the software It is not an alternative to white-box techniques Rather it is a complementary approach that is likely to uncover a different class of errors than white-box methods Black-box testing attempts to find the following types of errors

Incorrect or missing functions Interface errors Errors in data structures or external database access Performance errors and Initialization and termination errors

In white-box testing test cases are performing early n the testing processes where as in black-box testing process it is applied during later stages of testing as the attention is focused on the information domain

System ImplementationImplementation is the process of having system personal check out and provides new equipments into use train the users to install a new application and construct any files of data needed to use it

There are three types of implementation

1110183Implementation of computer system to replace a manual system The problems encountered are covering files training users creating accurate files and verifying print outs for integrity

1110183Implementation of a new computer system to replace an existing one This is usually difficult conversion If not properly planned there can be many problems So large computer systems may take as long as a year to convert

1110183Implementation of a modified application to replace the existing one using the same computer This type of conversion is relatively easy to handle usually there are no major changes in the file

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 39: Medicine distribution system

SAMPLE CODINGS

SAMPLE CODINGS

COMMON HEADER FILESusing Systemusing SystemCollectionsGenericusing SystemComponentModelusing SystemDatausing SystemDrawingusing SystemLinqusing SystemTextusing SystemWindowsFormsusing SystemDataSqlClient

DBCONnamespace Nadia class DBCon public static SqlConnection Connection static DBCon() try Connection = new SqlConnection() ConnectionString = Data Source=SQLEXPRESSInitial Catalog=Distribution_DBIntegrated Security=SSPIPersist Security Info=false ConnectionOpen() catch (Exception Ex)

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 40: Medicine distribution system

MessageBoxShow(ExMessage) public static Boolean Execution(string Query) SqlCommand Command = new SqlCommand(Query DBConConnection) if (CommandExecuteNonQuery() == 1) return true else return false public static DataTable SearchRecord(string SearchQuery) SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) DataTable DT = DssTables[0] if (DTRowsCount == 0) return null else return DT public static void BindGridlookupEditCtrl(GridLookUpEdit GrdLokup string Query string DisplayMember string ValueMember) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdLokupPropertiesDataSource = DT GrdLokupPropertiesDisplayMember = DisplayMember GrdLokupPropertiesValueMember = ValueMember

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 41: Medicine distribution system

GrdLokupRefresh() public static void BindGridCtrl(GridControl GrdCtrl string Query) DataTable DT = new DataTable() DT = SearchRecord(Query) if (DT == null) else GrdCtrlDataSource = DT

GrdCtrlRefresh() public static string AutoNumber(string TblName string FldName) string SearchQuery = select Max( + FldName + ) from + TblName SqlCommand Command = new SqlCommand(SearchQuery DBConConnection) SqlDataAdapter DAA = new SqlDataAdapter() DAASelectCommand = Command DataSet Dss = new DataSet() DssBeginInit() DAAFill(Dss) if (DssTables[0] == null) return 1 else DataTable DT = DssTables[0] return ((ConvertToInt16(DTRows[0][0]ToString()) + 1))ToString() public static void InsertQuery(string insretqry) Execution(insretqry)

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 42: Medicine distribution system

MessageBoxShow(Record is saved successfully Information MessageBoxButtonsOK) public static void UpdateQuery(string updateqry) Execution(updateqry) MessageBoxShow(Record is Updated successfully Information MessageBoxButtonsOK) public static void DeleteQuery(string deleteqry) Execution(deleteqry) MessageBoxShow(Record is Deleted successfully Information MessageBoxButtonsOK) public static void KeyPress_Text(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122)) if ((eKeyChar) = 32) eHandled = true if ((eKeyChar) == 8) eHandled = false public static void KeyPress_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 43: Medicine distribution system

public static void KeyPress_Text_Numeric(object sender KeyPressEventArgs e) if (((eKeyChar) lt 65) || ((eKeyChar) gt 90) ampamp ((eKeyChar) lt 97) || ((eKeyChar) gt 122))ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) if (((eKeyChar) = 32) ampamp ((eKeyChar) lt 48) || ((eKeyChar) gt 57)) eHandled = true if ((eKeyChar) == 8) eHandled = false

Provincenamespace Nadia public partial class Province Form VARIABLE DECLARED public string txtcode public string txtname public string selectQrycode public DataTable DT public Province() InitializeComponent()

private void btn_save_Click(object sender EventArgs e)

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 44: Medicine distribution system

IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_Province (Prov_idProv_codeProv_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) AUTO NUMBER FOR ID AND CODE txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

DBConBindGridCtrl(GC Select from Tbl_Province)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) txt_nameText =

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 45: Medicine distribution system

try selectQrycode = (select from Tbl_Province where Prov_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Province set Prov_name= + txt_nameText + where Prov_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText =

private void btn_dlt_Click(object sender EventArgs e)

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 46: Medicine distribution system

try

string deleteqry = Delete from Tbl_Province where Prov_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void Province_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Province Prov_id)) txt_codeText = (DBConAutoNumber(Tbl_Province Prov_code)) DBConBindGridCtrl(GC Select from Tbl_Province) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Found)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 47: Medicine distribution system

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

District namespace Nadia public partial class District Form public string txtprovcode public string selectQrycode public DataTable DT public District() InitializeComponent()

private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_DistrictOnProvince where Dist_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_prov_codePropertiesDataSource = DT

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 48: Medicine distribution system

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_District set Dist_name= + txt_nameText + where Dist_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_prov_codeText =

private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 49: Medicine distribution system

string deleteqry = Delete from Tbl_District where Dist_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) txt_nameText = grd_prov_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void btnAddProvince_Click(object sender EventArgs e)

Province frmprovince = new Province() frmprovinceShowDialog()

private void District_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code))

DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 50: Medicine distribution system

Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch MessageBoxShow(Record not found )

private void btnAddProvince_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_prov_code Select From Tbl_Province Prov_name Prov_code)

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btn_save_Click(object sender EventArgs e) IF TEXTBOX IS EMPTY THEN MESSAGE DIPLAY AND FOCUS MOVES NAME TEXTBOX

if (grd_prov_codeText == )

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 51: Medicine distribution system

MessageBoxShow(Please Select Province) grd_prov_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtprovcode = (grd_prov_codeEditValue)ToString()

string insertqry = INSERT into Tbl_District (Dist_idDist_codeProv_codeDist_name ) Values ( + txt_idText + + txt_codeText + + txtprovcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_District Dist_id)) txt_codeText = (DBConAutoNumber(Tbl_District Dist_code)) DBConBindGridCtrl(GC Select Dist_idDist_codeDist_namedboTbl_DistrictProv_codeProv_name from Tbl_District join Tbl_Province on Tbl_DistrictProv_code=Tbl_ProvinceProv_code) DBConBindGridCtrl(GC Select from V_DistrictOnProvince) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save) txt_nameText = grd_prov_codeText =

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 52: Medicine distribution system

Sub Area namespace Nadia public partial class SubArea Form public string txtdistcode public string selectQrycode public DataTable DT public SubArea() InitializeComponent()

private void SubArea_Load(object sender EventArgs e) try

txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch MessageBoxShow(Record not found )

private void btn_save_Click(object sender EventArgs e)

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 53: Medicine distribution system

if (grd_dist_codeText == ) MessageBoxShow(Please Select Province) grd_dist_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtdistcode= (grd_dist_codeEditValue)ToString() string insertqry = INSERT into Tbl_Subarea (Subarea_idSubarea_codeDist_codeSubarea_name ) Values ( + txt_idText + + txt_codeText + + txtdistcode + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) DBConBindGridCtrl(GC Select Subarea_idSubarea_codeSubarea_namedboTbl_SubareaDist_codeDist_name from Tbl_Subarea join Tbl_District on Tbl_SubareaDist_code=Tbl_DistrictDist_code) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch(Exception EX) MessageBoxShow(EXMessage Record not Save) txt_nameText = grd_dist_codeText=

private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 54: Medicine distribution system

try selectQrycode = (Select from V_DistrictOnSubrea where subarea_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search)

private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Subarea set Subarea_name= + txt_nameText + where Subarea_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = grd_dist_codeText =

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 55: Medicine distribution system

private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Subarea where Subarea_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_DistrictOnSubrea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Subarea Subarea_id)) txt_codeText = (DBConAutoNumber(Tbl_Subarea Subarea_code)) txt_nameText = grd_dist_codeText =

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 56: Medicine distribution system

private void btnAddDistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void btnAdd_District_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select Dist_id as ID Dist_Code as CODE Dist_name as NAMEdboTbl_DistrictProv_code as [Province Code]Prov_name as [Province Name] from Tbl_District join Tbl_Province on Tbl_DistrictProv_code =Tbl_ProvinceProv_code NAME CODE)

Company namespace Nadia public partial class Company Form public string txtname public int txtCode public string selectQrycode public DataTable DT public Company() InitializeComponent() private void Company_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 57: Medicine distribution system

DBConBindGridCtrl(GC Select from Tbl_Company) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Company (Comp_idComp_codeComp_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code))

DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) TryselectQrycode = (Select from Tbl_Company where Comp_code like +txt_codeText+ ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 58: Medicine distribution system

txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Company set Comp_name= + txt_nameText + where Comp_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) txt_nameText= private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Company where Comp_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Company) catch (Exception Ex)

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 59: Medicine distribution system

MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Company Comp_id)) txt_codeText = (DBConAutoNumber(Tbl_Company Comp_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Categorynamespace Nadia public partial class Category Form public string txtname public string selectQrycode public DataTable DT public Category() InitializeComponent() private void Category_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 60: Medicine distribution system

try txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_Category (Cat_idCat_codeCat_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e)

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 61: Medicine distribution system

try selectQrycode = (Select from Tbl_Category where Cat_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Category set Cat_name= + txt_nameText + where Cat_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 62: Medicine distribution system

string deleteqry = Delete from Tbl_Category where Cat_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_Category) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Category Cat_id)) txt_codeText = (DBConAutoNumber(Tbl_Category Cat_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Measuring Unit namespace Nadia public partial class MeasuringUnit Form public string txtname public string selectQrycode public DataTable DT

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 63: Medicine distribution system

public MeasuringUnit() InitializeComponent() private void MeasuringUnit_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try string insertqry = INSERT into Tbl_MeasuringUnit (Munit_idMunit_codeMunit_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 64: Medicine distribution system

catch (Exception Ex) EXCEPTION WILL CATCH AND SHOW AT RUN TIME MessageBoxShow(ExMessage Record not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_MeasuringUnit where Munit_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_MeasuringUnit set Munit_name= + txt_nameText + where Munit_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) txt_nameText =

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 65: Medicine distribution system

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_MeasuringUnit where Munit_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_MeasuringUnit)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_id)) txt_codeText = (DBConAutoNumber(Tbl_MeasuringUnit Munit_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 66: Medicine distribution system

Product namespace Nadia public partial class Product Form public string txtcatcode public string txtmunitcode public string txtcompcode public string selectQrycode public DataTable DT public Product() InitializeComponent() private void Product_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code))

DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balancedboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code)

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 67: Medicine distribution system

DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_cat_codeText == ) MessageBoxShow(Please Select Category) grd_cat_codeFocus() else if (grd_comp_codeText == ) MessageBoxShow(Please Select Company) grd_comp_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_munit_codeText == ) MessageBoxShow(Please Select Measuring Unit) grd_munit_codeFocus() else if (txt_packsizeText == ) MessageBoxShow(Please Enter Pack Size) txt_packsizeFocus() else if (txt_loosequantityText == ) MessageBoxShow(Please Enter Quantity) txt_loosequantityFocus()

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 68: Medicine distribution system

else if (txt_weightText == ) MessageBoxShow(Please Enter Weight) txt_weightFocus() else if (caledit_unitpriceValue == 0) MessageBoxShow(Please Enter Unit Price) caledit_unitpriceFocus() else if (caledit_tradepriceValue == 0) MessageBoxShow(Please Enter Trade Price) caledit_tradepriceFocus() else if (caledit_retailpriceValue == 0) MessageBoxShow(Please Enter Retail Price) caledit_retailpriceFocus() else if (txt_reorderlevelText == ) MessageBoxShow(Please Enter ReOrder Level) txt_reorderlevelFocus() else if (txt_openstockText == ) MessageBoxShow(Please Enter Stock) txt_openstockFocus() else if (caledit_openbalanceValue == 0) MessageBoxShow(Please Enter Balance) caledit_openbalanceFocus() else try txtcatcode = (grd_cat_codeEditValue)ToString()

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 69: Medicine distribution system

txtcompcode = (grd_comp_codeEditValue)ToString() txtmunitcode = (grd_munit_codeEditValue)ToString() string insertqry = INSERT into Tbl_Product (Pro_idPro_codeCat_codeComp_codePro_nameMunit_codePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance ) Values ( + txt_idText + + txt_codeText + + txtcatcode + + txtcompcode + + txt_nameTextToString() + + txtmunitcode + + txt_packsizeTextTrim() + + txt_loosequantityTextTrim() + + txt_weightTextTrim() + + caledit_unitpriceValue + + caledit_tradepriceValue + + caledit_retailpriceValue + + txt_openstockTextTrim() + + txt_reorderlevelTextTrim() + + caledit_openbalanceValue + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) DBConBindGridCtrl(GC Select Pro_idPro_codePro_namePack_SizeLooseQtyPro_WeightUnit_PriceTrade_PriceRetail_PriceReOrder_LevelOpen_stockOpen_balance dboTbl_CategoryCat_nameTbl_MeasuringUnitMunit_nameTbl_CompanyComp_name from Tbl_Product join Tbl_Category on Tbl_ProductCat_code=Tbl_CategoryCat_code join Tbl_MeasuringUnit on Tbl_ProductMunit_code=Tbl_MeasuringUnitMunit_code join Tbl_Company on Tbl_ProductComp_code=Tbl_CompanyComp_code ) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (select from V_CatCompMunitOnProduct where Pro_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString())

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 70: Medicine distribution system

txt_nameText = (DTRows[0][4])ToString() txt_packsizeText = (DTRows[0][6])ToString() txt_loosequantityText = (DTRows[0][7])ToString() txt_weightText = (DTRows[0][8])ToString() caledit_unitpriceValue = (ConvertToDecimal(DTRows[0][9])) caledit_tradepriceValue = (ConvertToDecimal(DTRows[0][10])) caledit_retailpriceValue = (ConvertToDecimal(DTRows[0][11])) txt_reorderlevelText = (DTRows[0][12])ToString() txt_openstockText = (DTRows[0][13])ToString() caledit_openbalanceValue = (ConvertToDecimal(DTRows[0][14])) grd_cat_codePropertiesDataSource =DT (DTRows[0][2])ToString() grd_munit_codePropertiesDataSource =DT (DTRows[0][5])ToString() grd_comp_codePropertiesDataSource = DT (DTRows[0][3])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_Product set Pro_name = + txt_nameText + Pack_Size= + txt_packsizeText + LooseQty= + txt_loosequantityText + Pro_Weight= + txt_weightText + Unit_Price= + caledit_unitpriceValue + Trade_Price= + caledit_tradepriceValue + Retail_Price= + caledit_retailpriceValue + ReOrder_Level= + txt_reorderlevelText + Open_stock= + txt_openstockText + Open_balance= + caledit_openbalanceValue + where Pro_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 71: Medicine distribution system

txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_loosequantityText = txt_nameText = txt_openstockText = txt_packsizeText = txt_reorderlevelText = txt_weightText = grd_cat_codeText = grd_comp_codeText = grd_munit_codeText = caledit_openbalanceValue = 0 caledit_retailpriceValue = 0 caledit_tradepriceValue = 0 caledit_unitpriceValue = 0 private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_Product where Pro_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_CatCompMunitOnProduct)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 72: Medicine distribution system

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_Product Pro_id)) txt_codeText = (DBConAutoNumber(Tbl_Product Pro_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_packsize_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_loosequantity_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_weight_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_reorderlevel_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e)

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 73: Medicine distribution system

private void txt_openstock_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void btnaddcategory_Click(object sender EventArgs e) Category frmcategory = new Category() frmcategoryShowDialog() private void btnaddcompany_Click(object sender EventArgs e) Company frmcompany = new Company() frmcompanyShowDialog() private void btnaddmeasuringunit_Click(object sender EventArgs e) MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog() private void btnaddcategory_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_cat_code Select From Tbl_Category Cat_name Cat_code)

private void btnaddcompany_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_comp_code Select From Tbl_Company Comp_name Comp_code) private void btnaddmeasuringunit_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_munit_code Select From Tbl_MeasuringUnit Munit_name Munit_code)

Basic Type Account

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 74: Medicine distribution system

namespace Nadia public partial class BasicTypeAccount Form public string txtcode public string txtname public string selectQrycode public DataTable DT public BasicTypeAccount() InitializeComponent() private void BasicTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 75: Medicine distribution system

string insertqry = INSERT into Tbl_AccountBasicType (BasicTAcc_idBasicTAcc_codeBasicTAcc_name) Values ( + txt_idText + + txt_codeText + + txt_nameText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountBasicType set BasicTAcc_name= + txt_nameText + where BasicTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType)

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 76: Medicine distribution system

catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText = txt_nameText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountBasicType where BasicTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from Tbl_AccountBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountBasicType BasicTAcc_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 77: Medicine distribution system

DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

Head Account namespace Nadia public partial class HeadAccount Form public string txtacctypecode public string selectQrycode public DataTable DT public HeadAccount() InitializeComponent() private void HeadAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 78: Medicine distribution system

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e) if (grd_acctype_codeText == ) MessageBoxShow(Please Select Type) grd_acctype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() thisClose() else try txtacctypecode = (grd_acctype_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountHead (HeadAcc_idHeadAcc_codeBasicTAcc_codeHeadAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtacctypecode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 79: Medicine distribution system

DBConBindGridCtrl(GC Select HeadAcc_idHeadAcc_codeHeadAcc_nameDescriptiondboTbl_AccountHeadBasicTAcc_codeBasicTAcc_name from Tbl_AccountHead join Tbl_AccountBasicType on Tbl_AccountHeadBasicTAcc_code=Tbl_AccountBasicTypeBasicTAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record not Save ) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccountHeadOnAccounBasicType where HeadAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_acctype_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountHead set HeadAcc_name= + txt_nameText + Description = + txt_desc + where HeadAcc_code like + txt_codeText + DBConUpdateQuery(updateqry)

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 80: Medicine distribution system

DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update)

txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code)) txt_nameText = txt_descText = private void btn_rfrsh_Click(object sender EventArgs e)

txt_codeText = txt_descText = txt_nameText = grd_acctype_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountHead where HeadAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccounBasicType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountHead HeadAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 81: Medicine distribution system

private void btn_cls_Click(object sender EventArgs e) thisClose()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void btnaddbasictypeaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_acctype_code Select From Tbl_AccountBasicType BasicTAcc_name BasicTAcc_code)

private void btnaddbasictypeaccount_Click(object sender EventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

LEADER TYPE ACCOUNT namespace Nadia

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 82: Medicine distribution system

public partial class LeadgerTypeAccount Form public string txtheadcode public string selectQrycode public DataTable DT public LeadgerTypeAccount() InitializeComponent() private void LeadgerTypeAccount_Load(object sender EventArgs e) try txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

DBConBindGridlookupEditCtrl(grd_headacc_code Select From Tbl_AccountHead HeadAcc_name HeadAcc_code) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_headacc_codeText == )

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 83: Medicine distribution system

MessageBoxShow(Please Select Head Account) grd_headacc_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else try txtheadcode = (grd_headacc_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadgerType (LeadgerTAcc_idLeadgerTAcc_codeHeadAcc_codeLeadgerTAcc_nameDescription ) Values ( + txt_idText + + txt_codeText + + txtheadcode + + txt_nameText + + txt_descText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) DBConBindGridCtrl(GC Select LeadgerTAcc_idLeadgerTAcc_codeLeadgerTAcc_nameTbl_AccountLeadgerTypeDescriptiondboTbl_AccountLeadgerTypeHeadAcc_codeHeadAcc_name from Tbl_AccountLeadgerType join Tbl_AccountHead on Tbl_AccountLeadgerTypeHeadAcc_code=Tbl_AccountHeadHeadAcc_code) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 84: Medicine distribution system

selectQrycode = (Select from V_AccountHeadOnAccntLeadgrType where LeadgerTAcc_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_headacc_codeText = (DTRows[0][3])ToString() txt_descText = (DTRows[0][4])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e) try string updateqry = Update Tbl_AccountLeadgerType set LeadgerTAcc_name= + txt_nameText + Description = + txt_desc + where LeadgerTAcc_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code)) txt_nameText= txt_descText=

private void btn_rfrsh_Click(object sender EventArgs e) txt_codeText =

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 85: Medicine distribution system

txt_descText = txt_nameText = grd_headacc_codeText = private void btn_dlt_Click(object sender EventArgs e) try string deleteqry = Delete from Tbl_AccountLeadgerType where LeadgerTAcc_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccountHeadOnAccntLeadgrType) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadgerType LeadgerTAcc_code))

private void btn_cls_Click(object sender EventArgs e) thisClose() private void btnaddhaedaccount_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_headacc_code Select from V_AccountHeadOnAccntBasicType HeadAcc_name HeadAcc_code)

private void btnaddhaedaccount_Click(object sender EventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 86: Medicine distribution system

private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_desc_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e)

LEADGER ACCOUNT namespace Nadia public partial class LeadgerAccount Form public string txtLeadgercode public string txtdistcode public string txtsubareacode public string selectQrycode public DataTable DT public LeadgerAccount() InitializeComponent() private void LeadgerAccount_Load(object sender EventArgs e)

try txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id))

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 87: Medicine distribution system

txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code))

DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select From Tbl_AccountLeadgerType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) DBConBindGridlookupEditCtrl(grd_dist_code Select From Tbl_District Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select From Tbl_Subarea Subarea_name Subarea_code) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea)

catch MessageBoxShow(Record not found ) private void btn_save_Click(object sender EventArgs e)

if (grd_ldgrtype_codeText == ) MessageBoxShow(Please Select Leadger Type) grd_ldgrtype_codeFocus() else if (txt_nameText == ) MessageBoxShow(Please Enter Name) txt_nameFocus() else if (grd_dist_codeText == )

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 88: Medicine distribution system

MessageBoxShow(Please Enter District) grd_dist_codeFocus() else if (grd_subarea_codeText == ) MessageBoxShow(Please Enter Sub Area) grd_subarea_codeFocus() else if (txt_addressText == ) MessageBoxShow(Please Enter Address) txt_addressFocus() else if (txt_landlineText == ) MessageBoxShow(Please Enter LandLine Number) txt_landlineFocus() else if (txt_mobText == ) MessageBoxShow(Please Enter Mobile Number) txt_mobFocus() else if (txt_mailText == ) MessageBoxShow(Please Enter Mobile Number) txt_mailFocus() else try txtLeadgercode = (grd_ldgrtype_codeEditValue)ToString() txtdistcode = (grd_dist_codeEditValue)ToString() txtsubareacode = (grd_subarea_codeEditValue)ToString() string insertqry = INSERT into Tbl_AccountLeadger (Leadger_idLeadger_codeLeadgerTAcc_codeLeadger_nameDist_codeSubarea_codeAddressLandlineMobileEmail ) Values ( + txt_idText + + txt_codeText + + txtLeadgercode + + txt_nameText + + txtdistcode +

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 89: Medicine distribution system

+ txtsubareacode + + txt_addressText + + txt_landlineText + + txt_mobText + + txt_mailText + ) DBConInsertQuery(insertqry) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Save) private void btn_srch_Click(object sender EventArgs e) try selectQrycode = (Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea where Leadger_code like + txt_codeText + ) DT = DBConSearchRecord(selectQrycode) txt_idText = (ConvertToInt16(DTRows[0][0])ToString()) txt_nameText = (DTRows[0][2])ToString() grd_dist_codeText = (DTRows[0][4])ToString() grd_ldgrtype_codeText = (DTRows[0][3])ToString() grd_subarea_codeText = (DTRows[0][5])ToString() txt_addressText = (DTRows[0][6])ToString() txt_landlineText = (DTRows[0][7])ToString() txt_mailText = (DTRows[0][9])ToString() txt_mobText = (DTRows[0][8])ToString() catch (Exception Ex) MessageBoxShow(ExMessage Record Not Search) private void btn_updt_Click(object sender EventArgs e)

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 90: Medicine distribution system

try string updateqry = Update Tbl_AccountLeadger set Leadger_name= + txt_nameText + where Leadger_code like + txt_codeText + DBConUpdateQuery(updateqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Update) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) txt_addressText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = private void btn_rfrsh_Click(object sender EventArgs e) txt_addressText = txt_codeText = txt_landlineText = txt_mailText = txt_mobText = txt_nameText = grd_dist_codeText = grd_ldgrtype_codeText = grd_subarea_codeText = private void btn_dlt_Click(object sender EventArgs e) try

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 91: Medicine distribution system

string deleteqry = Delete from Tbl_AccountLeadger where Leadger_code like + txt_codeText + DBConDeleteQuery(deleteqry) DBConBindGridCtrl(GC Select from V_AccLdgrOnAccLdgrTypeonDistOnSubarea) catch (Exception Ex) MessageBoxShow(ExMessage Record Not Delete) txt_idText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_id)) txt_codeText = (DBConAutoNumber(Tbl_AccountLeadger Leadger_code)) private void btn_cls_Click(object sender EventArgs e) thisClose() private void txt_id_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_code_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_name_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text(sender e) private void txt_address_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Text_Numeric(sender e) private void txt_landline_KeyPress(object sender KeyPressEventArgs e) DBConKeyPress_Numeric(sender e) private void txt_mob_KeyPress(object sender KeyPressEventArgs e)

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 92: Medicine distribution system

DBConKeyPress_Numeric(sender e) private void btnaddleadgertype_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_ldgrtype_code Select from V_AccHeadOnAccLdgrTypOnAccBasicType LeadgerTAcc_name LeadgerTAcc_code) private void btnadddistrict_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_dist_code Select from V_ProvonDist Dist_name Dist_code) private void btnaddsubarea_Leave(object sender EventArgs e) DBConBindGridlookupEditCtrl(grd_subarea_code Select from V_SubareaOnDistrictOnProv Subarea_name Subarea_code) private void btnadddistrict_Click(object sender EventArgs e) District frmdistrict = new District() frmdistrictShowDialog() private void btnaddsubarea_Click(object sender EventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

MDEST namespace Nadia public partial class MDEST DevExpressXtraBarsRibbonRibbonForm public MDEST()

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 93: Medicine distribution system

InitializeComponent()

private void barButtonProvince_ItemClick(object sender ItemClickEventArgs e) Province frmprovince = new Province() frmprovinceShowDialog()

private void barButtondistrict_ItemClick(object sender ItemClickEventArgs e) District frmdistrict = new District() frmdistrictShowDialog()

private void barButtonsubarea_ItemClick(object sender ItemClickEventArgs e) SubArea frmsubarea = new SubArea() frmsubareaShowDialog()

private void barButtoncategory_ItemClick(object sender ItemClickEventArgs e) Category frmcategory = new Category() frmcategoryShowDialog()

private void barButtoncompany_ItemClick(object sender ItemClickEventArgs e) Company frmcompany = new Company() frmcompanyShowDialog()

private void barButtonmeasuringunit_ItemClick(object sender ItemClickEventArgs e)

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 94: Medicine distribution system

MeasuringUnit frmmeasuringunit = new MeasuringUnit() frmmeasuringunitShowDialog()

private void barButtonproduct_ItemClick(object sender ItemClickEventArgs e) Product frmproduct = new Product() frmproductShowDialog()

private void barButtonleadgeraccount_ItemClick(object sender ItemClickEventArgs e) LeadgerAccount frmledgeracc = new LeadgerAccount() frmledgeraccShowDialog()

private void barButtonheadacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) HeadAccount frmheadacc = new HeadAccount() frmheadaccShowDialog()

private void barButtonbasictypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) BasicTypeAccount frmbasictypeacc = new BasicTypeAccount() frmbasictypeaccShowDialog()

private void barButtonleadgertypeacc_ItemClick(object sender DevExpressXtraBarsItemClickEventArgs e) LeadgerTypeAccount frmleadgertypeacc = new LeadgerTypeAccount() frmleadgertypeaccShowDialog()

Page 95: Medicine distribution system