ADS

Thursday, 17 June 2021

Payroll Management System asp.net project with source code

 Payroll Management System asp.net project with source code 

Payroll Login page


Payroll Management System asp.net project with source code Part

Step #1:
Open Visual Studio 2010

click on --> file menu

select--> New---select --->website

select empty web application

give project name as "PayrollMgtProject"


Step #2: Add a webpage that name is "Default.aspx" and write following html code

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>Payroll Management system</title>

    <meta charset="utf-8" />

        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

        <meta name="description" content="" />

        <meta name="author" content="" />

      

        <!-- Favicon-->

        <link rel="icon" type="image/x-icon" href="assets/img/favicon.ico" />

        <!-- Font Awesome icons (free version)-->

        <script src="https://use.fontawesome.com/releases/v5.15.3/js/all.js" crossorigin="anonymous"></script>

        <!-- Google fonts-->

        <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css" />

        <link href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css" />

        <!-- Core theme CSS (includes Bootstrap)-->

        <link href="css/styles.css" rel="stylesheet" />

 

        <style>

        #headder

        {

           <%-- background-image:url(Imgs/FMS2.png);--%>

            background-repeat:no-repeat;

            height:100%;           

            background-position: center

            background-size: cover;

           background

        }

        </style>

</head>

<body>

    <form id="form1" runat="server">

    <div>

    <!-- Navigation-->

        <nav class="navbar navbar-expand-lg bg-secondary text-uppercase fixed-top" id="mainNav">

            <div class="container">

                <a class="navbar-brand js-scroll-trigger" href="#page-top">Payroll Management system</a>

                <button class="navbar-toggler navbar-toggler-right text-uppercase font-weight-bold bg-primary text-white rounded" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">

                    Menu

                    <i class="fas fa-bars"></i>

                </button>

                <div class="collapse navbar-collapse" id="navbarResponsive">

                    <ul class="navbar-nav ml-auto">

                       <%-- <li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#portfolio">Portfolio</a></li>--%>

                        <li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#about">About</a></li>

                        <li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="#contact">Contact</a></li>

                        <li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="signin.aspx">SignIn</a></li>

                        <li class="nav-item mx-0 mx-lg-1"><a class="nav-link py-3 px-0 px-lg-3 rounded js-scroll-trigger" href="signup.aspx">SignUp</a></li>

                    </ul>

                </div>

            </div>

        </nav>

        <!-- Masthead-->

        <header class="masthead bg-primary text-white text-center" id="headder" style=" height:600px">

       

            <div class="container d-flex align-items-center flex-column">

                <!-- Masthead Avatar Image-->

                <%--<img class="masthead-avatar mb-5" src=" " alt="..." />--%>

                <!-- Masthead Heading-->

                <%--<h1 class="masthead-heading text-uppercase mb-0">Faculty Management System</h1>--%>

                <!-- Icon Divider-->

                <div class="divider-custom divider-light">

                    <div class="divider-custom-line"></div>

                    <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                    <div class="divider-custom-line"></div>

                </div>

                <!-- Masthead Subheading-->

                <p class="masthead-subheading font-weight-light mb-0" style="color:Yellow">This System Should Keep track of Manager & Employee records</p>

            </div>

        </header>

      

        <section class="page-section bg-primary text-white mb-0" id="about">

            <div class="container">

                <!-- About Section Heading-->

                <h2 class="page-section-heading text-center text-uppercase text-white">About</h2>

                <!-- Icon Divider-->

                <div class="divider-custom divider-light">

                    <div class="divider-custom-line"></div>

                    <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                    <div class="divider-custom-line"></div>

                </div>

                <!-- About Section Content-->

                <div class="row">

                    <div class="col-lg-4 ml-auto"><p class="lead"> Payroll Management system helps the faculty to communicate easily with students, to give students access to class documents, and for the convenience and transparency of the online gradebook. ... Generate flexible and reliable reports to manage faculty and staff effectively.</p></div>

                    <div class="col-lg-4 mr-auto"><p class="lead"> TO Manage faculty data, track their acticities and monitor

performance via a centralized faculty management system software

which stores all the information in a single database.

 

with the help of smart tools you get enhanced connectivity, accelerated progress and ensured compliance.</p></div>

                </div>

                <!-- About Section Button-->

                <div class="text-center mt-4">

                    <a class="btn btn-xl btn-outline-light" href="#">

                        <i class="fas fa-download mr-2"></i>

                        More

                    </a>

                </div>

            </div>

        </section>

        <!-- Contact Section-->

        <section class="page-section" id="contact">

            <div class="container">

                <!-- Contact Section Heading-->

                <h2 class="page-section-heading text-center text-uppercase text-secondary mb-0">Contact Me</h2>

                <!-- Icon Divider-->

                <div class="divider-custom">

                    <div class="divider-custom-line"></div>

                    <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                    <div class="divider-custom-line"></div>

                </div>

                <!-- Contact Section Form-->

                <div class="row">

                    <div class="col-lg-8 mx-auto">

                        <!-- To configure the contact form email address, go to mail/contact_me.php and update the email address in the PHP file on line 19.-->

                        <form id="contactForm" name="sentMessage" novalidate="novalidate">

                            <div class="control-group">

                                <div class="form-group floating-label-form-group controls mb-0 pb-2">

                                    <label>Name</label>                                  

                                    <asp:TextBox ID="name" class="form-control" placeholder="Please enter your name." runat="server"></asp:TextBox>

                                   

                                </div>

                            </div>

                            <div class="control-group">

                                <div class="form-group floating-label-form-group controls mb-0 pb-2">

                                    <label>Email Address</label>

                                   

                                    <asp:TextBox ID="email" class="form-control" placeholder="Please enter your Email Address" runat="server"></asp:TextBox>

                                  

                                </div>

                            </div>

                            <div class="control-group">

                                <div class="form-group floating-label-form-group controls mb-0 pb-2">

                                    <label>Phone Number</label>

                                   

                                    <asp:TextBox ID="phone" class="form-control" placeholder="Please enter your Phone Number" runat="server"></asp:TextBox>

                                    <p class="help-block text-danger"></p>

                                </div>

                            </div>

                            <div class="control-group">

                                <div class="form-group floating-label-form-group controls mb-0 pb-2">

                                    <label>Message</label>

                                  

                                    <asp:TextBox ID="message" class="form-control" placeholder="your Message" runat="server" TextMode="MultiLine"></asp:TextBox>

                                   

                                </div>

                            </div>

                            <br />

                            <div id="success"></div>

                            <%--<div class="form-group"><button class="btn btn-primary btn-xl" id="sendMessageButton" type="submit">Send</button>--%>

                            <asp:Button ID="sendMessageButton" runat="server" class="btn btn-primary btn-xl" Text="Send" OnClick="sendMessageButton_Click"></asp:Button>

                           

                            </div>

                        </form>

                    </div>

                </div>

            </div>

        </section>

        <!-- Footer-->

        <footer class="footer text-center">

            <div class="container">

                <div class="row">

                    <!-- Footer Location-->

                    <div class="col-lg-4 mb-5 mb-lg-0">

                        <h4 class="text-uppercase mb-4">Location</h4>

                        <p class="lead mb-0">

                            772 4th block Bangalore

                            <br />

                            Karnataka  India, 560041

                        </p>

                    </div>

                    <!-- Footer Social Icons-->

                    <div class="col-lg-4 mb-5 mb-lg-0">

                        <h4 class="text-uppercase mb-4">Around the Web</h4>

                        <a class="btn btn-outline-light btn-social mx-1" href="https://www.facebook.com/coderbaba"><i class="fab fa-fw fa-facebook-f"></i></a>

                        <a class="btn btn-outline-light btn-social mx-1" href="#!"><i class="fab fa-fw fa-twitter"></i></a>

                        <a class="btn btn-outline-light btn-social mx-1" href="#!"><i class="fab fa-fw fa-linkedin-in"></i></a>

                        <a class="btn btn-outline-light btn-social mx-1" href="https://www.instagram.com/coderbaba"><i class="fab fa-fw fa-dribbble"></i></a>

                    </div>

                    <!-- Footer About Text-->

                    <div class="col-lg-4">

                        <h4 class="text-uppercase mb-4">About Payroll Management system</h4>

                        <p class="lead mb-0">

                            FMS This System Should Keep track of Payroll Management system records,  created by

                            <a href="http://www.youtube.com/coderbaba">Payroll Management system.com</a>

                            .

                        </p>

                    </div>

                </div>

            </div>

        </footer>

        <!-- Copyright Section-->

        <div class="copyright py-4 text-center text-white">

            <div class="container">

                <small>

                    Copyright &copy; Payroll Management system

                   

                    <script>

                        document.write(new Date().getFullYear());

                    </script>

                </small>

            </div>

        </div>

        <!-- Scroll to Top Button (Only visible on small and extra-small screen sizes)-->

        <div class="scroll-to-top d-lg-none position-fixed">

            <a class="js-scroll-trigger d-block text-center text-white rounded" href="#page-top"><i class="fa fa-chevron-up"></i></a>

        </div>

        <!-- Portfolio Modals-->

        <!-- Portfolio Modal 1-->

        <div class="portfolio-modal modal fade" id="portfolioModal1" tabindex="-1" role="dialog" aria-labelledby="portfolioModal1Label" aria-hidden="true">

            <div class="modal-dialog modal-xl" role="document">

                <div class="modal-content">

                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">

                        <span aria-hidden="true"><i class="fas fa-times"></i></span>

                    </button>

                    <div class="modal-body text-center">

                        <div class="container">

                            <div class="row justify-content-center">

                                <div class="col-lg-8">

                                    <!-- Portfolio Modal - Title-->

                                    <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal1Label">Log Cabin</h2>

                                    <!-- Icon Divider-->

                                    <div class="divider-custom">

                                        <div class="divider-custom-line"></div>

                                        <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                                        <div class="divider-custom-line"></div>

                                    </div>

                                    <!-- Portfolio Modal - Image-->

                                    <img class="img-fluid rounded mb-5" src="assets/img/portfolio/cabin.png" alt="..." />

                                    <!-- Portfolio Modal - Text-->

                                    <p class="mb-5"> Lorem your text here</p>

                                    <button class="btn btn-primary" data-dismiss="modal">

                                        <i class="fas fa-times fa-fw"></i>

                                        Close Window

                                    </button>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

        <!-- Portfolio Modal 2-->

        <div class="portfolio-modal modal fade" id="portfolioModal2" tabindex="-1" role="dialog" aria-labelledby="portfolioModal2Label" aria-hidden="true">

            <div class="modal-dialog modal-xl" role="document">

                <div class="modal-content">

                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">

                        <span aria-hidden="true"><i class="fas fa-times"></i></span>

                    </button>

                    <div class="modal-body text-center">

                        <div class="container">

                            <div class="row justify-content-center">

                                <div class="col-lg-8">

                                    <!-- Portfolio Modal - Title-->

                                    <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal2Label">Tasty Cake</h2>

                                    <!-- Icon Divider-->

                                    <div class="divider-custom">

                                        <div class="divider-custom-line"></div>

                                        <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                                        <div class="divider-custom-line"></div>

                                    </div>

                                    <!-- Portfolio Modal - Image-->

                                    <img class="img-fluid rounded mb-5" src="assets/img/portfolio/cake.png" alt="..." />

                                    <!-- Portfolio Modal - Text-->

                                    <p class="mb-5"> your text here</p>

                                    <button class="btn btn-primary" data-dismiss="modal">

                                        <i class="fas fa-times fa-fw"></i>

                                        Close Window

                                    </button>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

        <!-- Portfolio Modal 3-->

        <div class="portfolio-modal modal fade" id="portfolioModal3" tabindex="-1" role="dialog" aria-labelledby="portfolioModal3Label" aria-hidden="true">

            <div class="modal-dialog modal-xl" role="document">

                <div class="modal-content">

                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">

                        <span aria-hidden="true"><i class="fas fa-times"></i></span>

                    </button>

                    <div class="modal-body text-center">

                        <div class="container">

                            <div class="row justify-content-center">

                                <div class="col-lg-8">

                                    <!-- Portfolio Modal - Title-->

                                    <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal3Label">Circus Tent</h2>

                                    <!-- Icon Divider-->

                                    <div class="divider-custom">

                                        <div class="divider-custom-line"></div>

                                        <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                                        <div class="divider-custom-line"></div>

                                    </div>

                                    <!-- Portfolio Modal - Image-->

                                    <img class="img-fluid rounded mb-5" src="assets/img/portfolio/circus.png" alt="..." />

                                    <!-- Portfolio Modal - Text-->

                                    <p class="mb-5"> your text here </p>

                                    <button class="btn btn-primary" data-dismiss="modal">

                                        <i class="fas fa-times fa-fw"></i>

                                        Close Window

                                    </button>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

        <!-- Portfolio Modal 4-->

        <div class="portfolio-modal modal fade" id="portfolioModal4" tabindex="-1" role="dialog" aria-labelledby="portfolioModal4Label" aria-hidden="true">

            <div class="modal-dialog modal-xl" role="document">

                <div class="modal-content">

                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">

                        <span aria-hidden="true"><i class="fas fa-times"></i></span>

                    </button>

                    <div class="modal-body text-center">

                        <div class="container">

                            <div class="row justify-content-center">

                                <div class="col-lg-8">

                                    <!-- Portfolio Modal - Title-->

                                    <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal4Label">Controller</h2>

                                    <!-- Icon Divider-->

                                    <div class="divider-custom">

                                        <div class="divider-custom-line"></div>

                                        <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                                        <div class="divider-custom-line"></div>

                                    </div>

                                    <!-- Portfolio Modal - Image-->

                                    <img class="img-fluid rounded mb-5" src="assets/img/portfolio/game.png" alt="..." />

                                    <!-- Portfolio Modal - Text-->

                                    <p class="mb-5">your text here.</p>

                                    <button class="btn btn-primary" data-dismiss="modal">

                                        <i class="fas fa-times fa-fw"></i>

                                        Close Window

                                    </button>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

        <!-- Portfolio Modal 5-->

        <div class="portfolio-modal modal fade" id="portfolioModal5" tabindex="-1" role="dialog" aria-labelledby="portfolioModal5Label" aria-hidden="true">

            <div class="modal-dialog modal-xl" role="document">

                <div class="modal-content">

                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">

                        <span aria-hidden="true"><i class="fas fa-times"></i></span>

                    </button>

                    <div class="modal-body text-center">

                        <div class="container">

                            <div class="row justify-content-center">

                                <div class="col-lg-8">

                                    <!-- Portfolio Modal - Title-->

                                    <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal5Label">Locked Safe</h2>

                                    <!-- Icon Divider-->

                                    <div class="divider-custom">

                                        <div class="divider-custom-line"></div>

                                        <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                                        <div class="divider-custom-line"></div>

                                    </div>

                                    <!-- Portfolio Modal - Image-->

                                    <img class="img-fluid rounded mb-5" src="assets/img/portfolio/safe.png" alt="..." />

                                    <!-- Portfolio Modal - Text-->

                                    <p class="mb-5">your text here </p>

                                    <button class="btn btn-primary" data-dismiss="modal">

                                        <i class="fas fa-times fa-fw"></i>

                                        Close Window

                                    </button>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

        <!-- Portfolio Modal 6-->

        <div class="portfolio-modal modal fade" id="portfolioModal6" tabindex="-1" role="dialog" aria-labelledby="portfolioModal6Label" aria-hidden="true">

            <div class="modal-dialog modal-xl" role="document">

                <div class="modal-content">

                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">

                        <span aria-hidden="true"><i class="fas fa-times"></i></span>

                    </button>

                    <div class="modal-body text-center">

                        <div class="container">

                            <div class="row justify-content-center">

                                <div class="col-lg-8">

                                    <!-- Portfolio Modal - Title-->

                                    <h2 class="portfolio-modal-title text-secondary text-uppercase mb-0" id="portfolioModal6Label">Submarine</h2>

                                    <!-- Icon Divider-->

                                    <div class="divider-custom">

                                        <div class="divider-custom-line"></div>

                                        <div class="divider-custom-icon"><i class="fas fa-star"></i></div>

                                        <div class="divider-custom-line"></div>

                                    </div>

                                    <!-- Portfolio Modal - Image-->

                                    <img class="img-fluid rounded mb-5" src="assets/img/portfolio/submarine.png" alt="..." />

                                    <!-- Portfolio Modal - Text-->

                                    <p class="mb-5">your text here.</p>

                                    <button class="btn btn-primary" data-dismiss="modal">

                                        <i class="fas fa-times fa-fw"></i>

                                        Close Window

                                    </button>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

        <!-- Bootstrap core JS-->

        <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>

        <!-- Third party plugin JS-->

        <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>

        <!-- Contact form JS-->

        <script src="assets/mail/jqBootstrapValidation.js"></script>

        <script src="assets/mail/contact_me.js"></script>

        <!-- Core theme JS-->

        <script src="js/scripts.js"></script>

    </div>

    </form>

</body>

</html>

 

 

---------------------------------------------------------

Step 3#:
create a new page signin.aspx

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>signin</title>

    <meta charset="utf-8" />

        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

        <meta name="description" content="" />

        <meta name="author" content="" />

      

        <!-- Favicon-->

        <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />

        <!-- Core theme CSS (includes Bootstrap)-->

        <link href="css/styles.css" rel="stylesheet" />

</head>

<body onload="showBoth()">

    <form id="form1" runat="server">

    <div>

    <!-- Navigation-->

        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">

            <div class="container">

                <a class="navbar-brand" href="Default.aspx">Faculty Management System</a>

                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>

                <div class="collapse navbar-collapse" id="navbarResponsive">

                    <ul class="navbar-nav ml-auto">

                        <li class="nav-item active">

                            <a class="nav-link" href="Default.aspx">

                                Home

                                <span class="sr-only">(current)</span>

                            </a>

                        </li>

                        <%--<li class="nav-item"><a class="nav-link" href="#!">About</a></li>

                        <li class="nav-item"><a class="nav-link" href="#!">Services</a></li>

                        <li class="nav-item"><a class="nav-link" href="#!">Contact</a></li>--%>

                    </ul>

                </div>

            </div>

        </nav>

 

        <!-- Page Content-->

        <div class="container">

        <br />

        <br />

            <!-- Jumbotron Header-->

             <asp:Panel ID="pnl_warning" runat="server" Visible="false">

                                        <div class="form-group card-header text-center">

                                            <div class="alert-danger">

                                                <asp:Label ID="lbl_warning" runat="server" Text="Label" CssClass="col-form-label text-center"></asp:Label>

                                            </div>

                                        </div>

                                    </asp:Panel>

            <!-- Page Features-->

            <div class="row text-center">

            <br />

                <div class="col-lg-3 col-md-6 mb-4">

                  

                </div>

                <div class="col-lg-6 col-md-6 mb-4">

 

              

                    <div class="card h-100">

                       

                        <div class="card-body">

                            <h4 class="card-title">Secure Login</h4>

                            <p class="card-text"> </p>

 

                            <table class="table">

                            <tr>

                            <td>Email ID:</td>

                            <td>

            <asp:TextBox ID="txtEmail" CssClass="form-control"  runat="server" autofocus="" placeholder="Enter Email"></asp:TextBox>

            <asp:RequiredFieldValidator ID="rqr_emil" runat="server" ErrorMessage="Enter Email" ControlToValidate="txtEmail" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>

           

            </td>

                            </tr>

 

                            <tr>

                            <td>Password:</td>

                            <td>

                            <asp:TextBox ID="txtPassword" CssClass="form-control"  runat="server" placeholder="Enter password" TextMode="Password" onfocus="showPass()"></asp:TextBox>

                            <asp:RequiredFieldValidator ID="rqr_pass" runat="server" ErrorMessage="Enter password" ControlToValidate="txtPassword" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator>

                            </td>

                           

                            </tr>

 

                            <tr>

                            <td colspan="2">

                             <div class="form-group">

                                            <div class="form-check">

                                                <label class="form-check-label">

                                                    <asp:CheckBox ID="chk_remember" runat="server" CssClass="form-check-input remembermecustom" />

                                                    Remember Password</label>

 

                                            </div>

                                            <div class="form-check">

                                                <label class="form-check-label">

                                                    <asp:CheckBox ID="CheckBox2" runat="server" CssClass="form-check-input remembermecustom" />

                                                    Keep last ID & Password

                                                </label>

                                            </div>

                                        </div>

                            </td>

                            </tr>

 

 

 

                            <tr>

                            <td colspan="2">

                <asp:Button ID="btnlogin" CssClass=" btn btn-success btn-block" runat="server" Text="Login"

                                    onclick="btnlogin_Click"  /></td>

                            <%--<td> <asp:Button ID="btncancel" CssClass=" btn btn-danger" runat="server"

                                    Text="Cancel" onclick="btncancel_Click" /></td>--%>

                            </tr>

                            </table>

                        </div>

                        <div class="card-footer"><a class="btn btn-link" href="signup.aspx">New Account SignUp!</a></div>

                    </div>

                </div>

              

                <div class="col-lg-3 col-md-6 mb-4">

                   

                </div>

            </div>

        </div>

        <!-- Footer-->

        <br />

        <br />

       

        <footer class="py-5 bg-dark">

            <div class="container"><p class="m-0 text-center text-white">Copyright © FacultyManagementSystem 2021</p></div>

        </footer>

        <!-- Bootstrap core JS-->

        <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>

        <!-- Core theme JS-->

        <script src="js/scripts.js"></script>

 

        </div>

    </div>

    </form>

     <script type="text/javascript">

 

         function showPass() {

             var cookies = document.cookie;

             var allcookie = cookies.split(";");

             for (ctr = 0; ctr < allcookie.length; ctr++) {

                 var dt = allcookie[ctr];

                 var str = dt.split("=");

                 if (str[0].trim() == document.getElementById("txtEmail").value.trim()) {

                     document.getElementById("txtPassword").value = str[1];

                     break;

                 }

             }

         }

         function showBoth() {

             var cookies = document.cookie;

             var allcookie = cookies.split(";");

             for (c = 0; c < allcookie.length; c++) {

                 var a = allcookie[c];

                 var v = a.split("=");

                 if (v[0].trim() == "erplastid")

                     document.getElementById("txtEmail").value = v[1];

                 if (v[0].trim() == "erplastpass") {

                     document.getElementById("txtPassword").value = v[1];

                     break;    }

             }

         } 

    </script>

</body>

</html>

 

-------------------------------------------------------

Step 4#:

Write Following C# code Signin.aspx.cs


using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

using System.Data.SqlClient;

using System.Configuration;

 

public partial class signin : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

 

    }

    public string GetConnectionString()

    {

        return System.Configuration.ConfigurationManager.ConnectionStrings["PMS"].ConnectionString;

    }

    protected void btnlogin_Click(object sender, EventArgs e)

    {

        if (IsFormValid())

        {

            using (SqlConnection con = new SqlConnection(GetConnectionString()))

            {

                SqlCommand cmd = new SqlCommand("usp_UsersCheckLoginDetails", con);

                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@UserName", txtEmail.Text.Trim());

                cmd.Parameters.AddWithValue("@Password", txtPassword.Text.Trim());

                try

                {

                    if (con.State == ConnectionState.Closed)

                    {

                        con.Open();

                    }

 

 

                    SqlDataReader dr = cmd.ExecuteReader();

                    if (dr.HasRows)

                    {

                        while (dr.Read())

                        {

 

                            if (chk_remember.Checked)

                            {

                                HttpCookie co = new HttpCookie(txtEmail.Text, txtPassword.Text);

                                co.Expires = DateTime.Now.AddMonths(1);

                                Response.Cookies.Add(co);

                            }

                            if (CheckBox2.Checked)

                            {

                                HttpCookie co1 = new HttpCookie("erplastid", txtEmail.Text);

                                co1.Expires = DateTime.Now.AddMonths(1);

                                Response.Cookies.Add(co1);

 

                                HttpCookie co2 = new HttpCookie("erplastpass", txtPassword.Text);

                                co2.Expires = DateTime.Now.AddMonths(1);

                                Response.Cookies.Add(co2);

                            }

 

                            Response.Write("<script>alert('" + dr.GetValue(0).ToString() + "')</script>");

                            Session["UserName"] = dr.GetValue(0).ToString();

                            Session["UserEmail"] = dr.GetValue(1).ToString();

 

                            Session["UserType"] = dr.GetValue(3).ToString();

 

                        }

                        if (Session["UserType"].ToString() == "Admin")

                        {

                            Response.Redirect("Admin/Home.aspx");

                        }

                        else if (Session["UserType"].ToString() == "Manager")

                        {

                            Response.Redirect("Manager/Home.aspx");

                        }

 

                        else if (Session["UserType"].ToString() == "Employee")

                        {

                            Response.Redirect("Employee/Home.aspx");

                        }

                        else

                        {

                            Response.Redirect("~/logout.aspx");

                        }

                    }

                    else

                    {

                        Response.Write("<script>alert('Invalid UserID or Password...Try again')</script>");

                        txtEmail.Text = string.Empty;

                        txtPassword.Text = string.Empty;

                        pnl_warning.Visible = true;

                        lbl_warning.Text = "Use correct email and password</br>";

                    }

                }

                catch (Exception ex)

                {

                    pnl_warning.Visible = true;

                    lbl_warning.Text = "Something went wrong! Contact your devloper </br>" + ex.Message;

                }

                finally

                {

                    con.Close();

                }

            }

        }

        else

        {

            pnl_warning.Visible = true;

            lbl_warning.Text = "Please fill all the requirements";

        }

    }

 

    private bool IsFormValid()

    {

        if (txtEmail.Text == string.Empty)

        {

            Response.Write("<script>alert('UserID is required')</script>");

            txtEmail.Text = string.Empty;

            txtEmail.Focus();

            return false;

        }

        if (txtPassword.Text == string.Empty)

        {

            Response.Write("<script>alert('UserID is required')</script>");

            txtPassword.Text = string.Empty;

            txtPassword.Focus();

            return false;

        }

        return true;

 

    }

}


------------------------

Step #5:

create following folder 


 1-Admin

 2-assests

 3-css

 4-Employee

 5-Imgs

 6-js

 7-Manager



Download All Folder from here   

Step #6:

create a master page inside admin folder named "AdminMasterPage.master" add following html 


<%@ Master Language="C#" AutoEventWireup="true" CodeFile="AdminMasterPage.master.cs" Inherits="Admin_AdminMasterPage" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

     <meta charset="utf-8" />

        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

        <meta name="description" content=" technologies" />

        <meta name="author" content="coderbaba" />

      

        <!-- Favicon-->

        <link rel="icon" type="image/x-icon" href="assets/favicon.ico" />

        <!-- Core theme CSS (includes Bootstrap)-->

        <link href="../css/styles.css" rel="stylesheet" />

        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <asp:ContentPlaceHolder id="head" runat="server">

    </asp:ContentPlaceHolder>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <nav class="navbar navbar-expand-lg navbar-dark bg-dark">

            <div class="container">

                <a class="navbar-brand" href="Home.aspx">Payroll Management system</a>

                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>

                <div class="collapse navbar-collapse" id="navbarResponsive">

                    <ul class="navbar-nav ml-auto">

                        <li class="nav-item active">

                            <a class="nav-link" href="Home.aspx">

                                Home

                                <span class="sr-only">(current)</span>

                            </a>

                        </li>

                        <li class="nav-item"><a class="nav-link" href="AddEmployee.aspx">Add Employee</a></li>

                        <li class="nav-item"><a class="nav-link" href="#">M2</a></li>

                        <li class="nav-item"><a class="nav-link" href="#">M3</a></li>

                        <li class="nav-item"><a class="nav-link" href="#">M4</a></li>

                        <li class="nav-item"><a class="nav-link" href="#">Setting</a></li>

                        <li class="nav-item"><a class="nav-link" href="#!">|</a></li>

                        <li class="nav-item"><a class="nav-link" href="#!">

                        <i class="fa fa-fw fa-user"></i>

                        <asp:Label ID="lb1" CssClass="glyphicon glyphicon-user" runat="server" Text="" style="text-transform:uppercase;color:Yellow;" font-bold="true"></asp:Label>

                        </a>

                        </li>

                        <li class="nav-item"><a class="nav-link" href="../logout.aspx">Logout</a></li>

                    </ul>

                </div>

            </div>

        </nav>

        <!-- Page Content-->

 

        <div class="container-fluid">

            <!-- Jumbotron Header-->

            

            <!-- Page Features-->

            <div class="row text-center">

                <div class="col-lg-12">

                   <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

       

                 </asp:ContentPlaceHolder>

                </div>            

            </div>

            <br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

            <br />

        </div>

         <!-- Footer-->

        <footer class="py-5 bg-dark">

            <div class="container"><p class="m-0 text-center text-white">Copyright © PayrollManagementSystem.com 2021</p></div>

        </footer>

        <!-- Bootstrap core JS-->

        <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>

        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js"></script>

        <!-- Core theme JS-->

        <script src="js/scripts.js"></script>

    </div>

    </form>

</body>

</html>

 

 ------------------------

Step #7:
write following code in web.config file

<connectionStrings> 

    <add name="PMS" providerName="System.Data.SqlClient" connectionString="Data Source=.;Initial Catalog=Payroll;Integrated Security=True;Connection Timeout=600"/>

  </connectionStrings>


Step #8: 
Add New Employee  add a new webpage in admin folder named as (AddEmployee.aspx)

-----------------------------------

<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" CodeFile="AddEmployee.aspx.cs" Inherits="Admin_AddEmployee" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<title>Employee Registration</title>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

 

<div class="container">

  <cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

    </cc1:ToolkitScriptManager>

    <div class="panel panel-primary">

      <div class="panel-heading"> <h2>Add Employee</h2>  </div>

      <div class="panel-body">

      <div class="row">

      <div class="col-md-3"></div>

      <div class="col-md-9">

      <table class="table table-responsive-sm" width="100%">     

      <tr>

      <td>Name</td>

      <td><asp:TextBox ID="TextBox1" CssClass=" form-control" runat="server"></asp:TextBox></td>

      </tr>

 

      <tr>

      <td>Designation</td>

      <td>    

          <asp:DropDownList ID="ddlDesignation" CssClass=" form-control" runat="server">

          </asp:DropDownList>

      </td>

      </tr>

      <tr>

      <td>UserName</td>

      <td><asp:TextBox ID="TextBox3" CssClass=" form-control" runat="server"></asp:TextBox></td>

      </tr>

      <tr>

      <td>Password</td>

      <td><asp:TextBox ID="TextBox4" CssClass=" form-control" runat="server" TextMode="Password"></asp:TextBox></td>

      </tr>

      <tr>

      <td>FatherName</td>

      <td> <asp:TextBox ID="TextBox5" CssClass=" form-control" runat="server"></asp:TextBox></td>

      </tr>

      <tr>

       <td style="width: 146px">  DOB(DD-MM-YYYY)</td>

       <td style="width: 42px">  <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>

                <cc1:CalendarExtender ID="TextBox6_CalendarExtender" runat="server"

                    Enabled="True" TargetControlID="TextBox6" Format="dd-MM-yyyy">

                </cc1:CalendarExtender>

            </td>            

        </tr>     

      <tr>

      <td>Address</td>

      <td><asp:TextBox ID="TextBox7" runat="server" CssClass=" form-control"></asp:TextBox></td>

      </tr>     

      <tr>

      <td>MobileNo</td>

      <td><asp:TextBox ID="TextBox8" runat="server" CssClass=" form-control"></asp:TextBox></td>

      </tr>     

      <tr>

      <td>Email</td>

      <td><asp:TextBox ID="TextBox9" runat="server" CssClass=" form-control"></asp:TextBox></td>

      </tr>     

      <tr>

      <td>Basic Salary</td>

      <td><asp:TextBox ID="TextBox10" runat="server" CssClass=" form-control"></asp:TextBox></td>

      </tr>  

        <tr>

            <td style="width: 146px">   DOJ</td>

            <td style="width: 42px"> <asp:TextBox ID="TextBox11" runat="server" ReadOnly="True" CssClass=" form-control"></asp:TextBox>

            </td>          

        </tr>

        <tr>

            <td colspan="2" style="text-align: center">   <asp:Button ID="Button1" runat="server" CssClass="btn btn-success" onclick="Button1_Click"  Text="Add Emp" Height="38px" Width="104px" />

                <a href="#" class="last">

                <asp:Button ID="Button2" CssClass="btn btn-danger" runat="server" style="margin-left: 16px" Text="Cancel"  Width="71px" onclick="Button2_Click" Height="38px" />

            </td>

            <td style="text-align: center">   &nbsp;</td>

        </tr>     

      </table>

      </div>

      </div>

      </div>

      <div class="panel-footer">     

      <div class="table table-responsive">

          <asp:GridView ID="GridView1" CssClass=" table table-hover" runat="server" EmptyDataText="Record Not found">

          </asp:GridView>     

      </div>     

      </div>

    </div>   

</div>

</asp:Content>

 

 

 Step #9:

write C# code:"AddEmployee.aspx.cs"

--------------------------------------------------

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

using System.Data.SqlClient;

using System.Configuration;

 

public partial class Admin_AddEmployee : System.Web.UI.Page

{

    protected void Page_Load(object sender, EventArgs e)

    {

        if(!this.IsPostBack)  {  BindDesignation(); BindGrid();  }       

    }

    private void BindDesignation()

    {

        SqlConnection con = new SqlConnection(GetConnectionString());

        SqlCommand cmd = new SqlCommand("select distinct ID,Designation from tblDesignation with(nolock) where Designation!=''", con);

        SqlDataAdapter da = new SqlDataAdapter(cmd);  DataTable dt = new DataTable();

        da.Fill(dt);

        if (dt.Rows.Count > 0)

        {

            ddlDesignation.DataSource = dt;

            ddlDesignation.DataTextField = "Designation";

            ddlDesignation.DataValueField = "ID";

            ddlDesignation.DataBind();

        }    

 

    }

 

    //--------------------Resuable method-------------------

    public string GetConnectionString()

    {

        return System.Configuration.ConfigurationManager.ConnectionStrings["PMS"].ConnectionString;

    }

    private Boolean InsertUpdateData(SqlCommand cmd)

    {

        SqlConnection con = new SqlConnection(GetConnectionString());

        cmd.CommandType = CommandType.StoredProcedure;

        cmd.Connection = con;

        try

        {

            con.Open();

            cmd.ExecuteNonQuery();

            return true;

        }

        catch (Exception ex)      

        {

            Response.Write(ex.Message);

            return false;

        }

        finally

        {

            con.Close();

            con.Dispose();

        }

    }

 

    //------------------

    protected void Button1_Click(object sender, EventArgs e)

    {

        if (TextBox1.Text != string.Empty && TextBox3.Text != string.Empty && TextBox4.Text != string.Empty && TextBox8.Text != string.Empty)

        {

            if(IsRecordExixt()) {

                Response.Write("<script>alert('Record already exist try again');</script>");

            }

            else        {

                SqlCommand cmd = new SqlCommand("spInsertEmp");

                cmd.Parameters.AddWithValue("@Name", TextBox1.Text);              

                cmd.Parameters.AddWithValue("@Designation", ddlDesignation.SelectedValue);

                cmd.Parameters.AddWithValue("@Username", TextBox3.Text);

                cmd.Parameters.AddWithValue("@Password", TextBox4.Text);

                cmd.Parameters.AddWithValue("@Fathername", TextBox5.Text);

                cmd.Parameters.AddWithValue("@DOB", TextBox6.Text);

                cmd.Parameters.AddWithValue("@Address", TextBox7.Text);

                cmd.Parameters.AddWithValue("@MobileNo", TextBox8.Text);

                cmd.Parameters.AddWithValue("@Email", TextBox9.Text);

                cmd.Parameters.AddWithValue("@BasicSalary", Convert.ToDouble(TextBox10.Text));

                cmd.Parameters.AddWithValue("@DOJ", DateTime.Now);

                if (Convert.ToInt32(InsertUpdateData(cmd)) >= 1)  {

                    Response.Write("<script>alert('Save successfull');</script>");  clr(); BindGrid();

                }

                else   {   Response.Write("<script>alert('operation fail error');</script>");     }

            }

        }

        else {   Response.Write("<script>alert('Validation error');</script>"); }

 

    }

 

    private bool IsRecordExixt()

    {

        try

        {   SqlConnection con = new SqlConnection(GetConnectionString());

            if (con.State == ConnectionState.Closed)  {   con.Open();  }

            SqlCommand cmd = new SqlCommand("select Name,Designation,Username,Password,MobileNo,Email from  dbo.addemployee where Name@Name and Designation=@Designation and Username=@Username and Password=@Password and MobileNo=@MobileNo and Email=@Email ", con);

            cmd.CommandType = CommandType.Text;

            cmd.Parameters.AddWithValue("@Name", TextBox1.Text);

            cmd.Parameters.AddWithValue("@Designation", ddlDesignation.SelectedValue);

            cmd.Parameters.AddWithValue("@Username", TextBox3.Text);

            cmd.Parameters.AddWithValue("@Password", TextBox4.Text);

            cmd.Parameters.AddWithValue("@MobileNo", TextBox8.Text);

            cmd.Parameters.AddWithValue("@Email", TextBox9.Text);          

            SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable();

            da.Fill(dt);  con.Close();

            if (dt.Rows.Count >= 1) {  return true;  }  else  {  return false;   }

        }

        catch (Exception ex)

        {

            Response.Write("<script>alert('exception error "+ex.Message+"');</script>");   

            return false;

        }

    }

    protected void Button2_Click(object sender, EventArgs e)

    {

 

    }

    private void clr()

    {

        TextBox1.Text = string.Empty;    TextBox3.Text = string.Empty;

        TextBox4.Text = string.Empty;        TextBox5.Text = string.Empty;

        TextBox6.Text = string.Empty;        TextBox8.Text = string.Empty;

        TextBox7.Text = string.Empty;        TextBox9.Text = string.Empty;

        TextBox10.Text = string.Empty;        TextBox11.Text = string.Empty;

        ddlDesignation.SelectedIndex = -1;

    }

 

    private void BindGrid()

    {

        SqlConnection con = new SqlConnection(GetConnectionString());

        SqlCommand cmd = new SqlCommand("select * from dbo.addemployee", con);

        SqlDataAdapter da = new SqlDataAdapter(cmd);        DataTable dt = new DataTable();

        da.Fill(dt);

        if (dt.Rows.Count > 0)

        {

            GridView1.DataSource = dt;  GridView1.DataBind();

        } else  {      GridView1.DataSource = null;  GridView1.DataBind();

        }

    }

}

 


No comments:

Post a Comment

Popular Posts