Friday, July 27, 2018

HOW TO DEVELOPED CAR PARKING MANAGEMENT SYSTEM IN ASP.NET | SRADHA WEBCREATIONS

HOW TO DEVELOPED CAR PARKING MANAGEMENT SYSTEM IN ASP.NET

CAR PARKING
DRIVER NAME
CAR NUMBER
ENTEY TIME
OUT TIME
DURATION OF PARKING
PAYMENT

 SAVE

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

public partial class CarParking : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
 protected void TextBoxOUTTIME_TextChanged(object sender, EventArgs e)
    {
        double dEntryTime = Convert.ToDouble(TextBoxENTRYTIME.Text);
        double dOuttime = Convert.ToDouble(TextBoxOUTTIME.Text);
        string dCarNumber = TextBoxCARNUMBER.Text;
        string sDriverName = TextBoxDRIVERNAME.Text;
        double dDuration;
        double dPayment;
        double dExtraHours;

        dDuration = dOuttime - dEntryTime;
        TextBoxDURATION.Text = Convert.ToString(dDuration);

        if (dDuration <= 12)
        {

            dPayment = 15.00;
        }
        else
        {
            dExtraHours = dDuration - 12;
            dPayment = (dExtraHours * 1.00) + 15.00;
        }
        TextBoxPAYMENT.Text = Convert.ToString(dPayment);
    }
   

protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
        string connectionstring= ConfigurationManager.ConnectionStrings["dbconnection"].ConnectionString;
        string insertsql = "insert into carparking (drivername,carnumber,entrytime,outtime,duration,payment)values(@drivername,@carnumber,@entrytime,@outtime,@duration,@payment)";

        using (SqlConnection myconnection = new SqlConnection(connectionstring))
       {
           myconnection.Open();
        SqlCommand mycommand=new SqlCommand(insertsql,myconnection);
  mycommand.Parameters.AddWithValue("@drivername",TextBoxDRIVERNAME.Text);
       mycommand.Parameters.AddWithValue("@carnumber",TextBoxCARNUMBER.Text);
        mycommand.Parameters.AddWithValue("@entrytime",TextBoxENTRYTIME.Text);
        mycommand.Parameters.AddWithValue("@outtime",TextBoxOUTTIME.Text);
        mycommand.Parameters.AddWithValue("@duration",TextBoxDURATION.Text);
        mycommand.Parameters.AddWithValue("@payment",TextBoxPAYMENT.Text);
       
mycommand.ExecuteNonQuery();
        myconnection.Close();
            }
}




Thursday, July 26, 2018

LABOUR OVER DUTY management system in asp.net | sradha webcreations

LABOUR OVER DUTY management system in asp.net



LABOUR OVERDUTY




ENTER LABOUR NAME

ENTER WORKING HOUR

LABOUR CHARGE

SAVE

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

public partial class LABOUR : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
 protected void TextBoxWORKING_TextChanged(object sender, EventArgs e)
    {
        string sName = TextBoxNAME.Text;
        int iWorkingHours = Convert.ToInt32(TextBoxWORKING.Text);
        double dLabourCharge;
        int iExtraHours;

        if (iWorkingHours <= 8)
        {
            dLabourCharge = 250;
        }
        else
        {
            iExtraHours = iWorkingHours - 8;
            dLabourCharge = (iExtraHours * 200)+250;
        }
        TextBoxLABOURCHARGE.Text = Convert.ToString(dLabourCharge);
    }
    protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
        string connectionstring = ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString;
        string insertsql = "insert into labourcharge(labourName,WorkingHours,LabourCharge)values(@labourName,@WorkingHours,@LabourCharge)";

        using (SqlConnection myconnection = new SqlConnection(connectionstring))
        {
            myconnection.Open();
            SqlCommand mycommand = new SqlCommand(insertsql, myconnection);
  mycommand.Parameters.AddWithValue("@labourname", TextBoxNAME.Text);
mycommand.Parameters.AddWithValue("@workinghours", TextBoxWORKING.Text); mycommand.Parameters.AddWithValue("labourcharge", TextBoxLABOURCHARGE.Text);

            mycommand.ExecuteNonQuery();
            mycommand.Clone();
        }
        TextBoxNAME.Text = string.Empty;
        TextBoxWORKING.Text = string.Empty;
        TextBoxLABOURCHARGE.Text = string.Empty;
      }
}


how to perform NESTED IF ELSE in asp.net | sradha webcreations

how to perform NESTED IF ELSE in asp.net 


NESTED IF ELSE
ENTER A NUMBER
OUTPUT

SAVE


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

public partial class NESTEDIF : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
        string connectionstring=ConfigurationManager.ConnectionStrings ["dbconnection"].ConnectionString;
        string insertsql = "insert into nestedif(enternumber,output)values(@enternumber,@output)";

        using (SqlConnection myconnection = new SqlConnection(connectionstring))
        {
            myconnection.Open();
            SqlCommand mycommand = new SqlCommand(insertsql,myconnection);
            mycommand.Parameters.AddWithValue("@enteranumber",TextBoxNUMBER.Text);
            mycommand.Parameters.AddWithValue("@output",TextBox2.Text);

            mycommand.ExecuteNonQuery();
            myconnection.Close();
        }

        TextBoxNUMBER.Text=string.Empty;
        TextBox2.Text=string.Empty;

        }

  protected void TextBoxNUMBER_TextChanged(object sender, EventArgs e)
    {
        int iDay = Convert.ToInt32(TextBoxNUMBER.Text);

        if (iDay == 1)
        {
            TextBox2.Text = "SUNDAY";
        }
        else if (iDay == 2)
        {
           TextBox2.Text = "MONDAY";
        }
        else if (iDay == 3)
        {
            TextBox2.Text = "TUESDAY";
        }
        else if (iDay == 4)
        {
            TextBox2.Text = "WEDNESDAY";
        }
        else if (iDay == 5)
        {
            TextBox2.Text = "THURSDAY";
        }
        else if (iDay == 6)
        {
            TextBox2.Text = "FRIDAY";
        }
        else if (iDay == 7)
        {
            TextBox2.Text = "SATURDAY";
        }
        else
        {
            TextBox2.Text = "invalid entry";
        }
    }

}





Wednesday, July 25, 2018

salary calculation on the basic of leave day in asp.net | sradha webcreations

salary calculation on the basic of leave day in asp.net

salary calculation on the basic of leave day


EMP NAME
BASIC SALAR
LEAVE DAY
HRA
TOTAL SALARY

SAVE


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.Security;

public partial class leaveday : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
   protected void TextBoxLEAVE_TextChanged(object sender, EventArgs e)
    {
        string sName = TextBoxNAME.Text;
        double dbasic = Convert.ToDouble(TextBoxBASIC.Text);
        int iLeave = Convert.ToInt32(TextBoxLEAVE.Text);
        double dHra;
        double dTotal;

        if (iLeave >= 15)
        {
            dHra = 0;
        }
        else
        {
            dHra = 1500;
        }
        TextBoxHRA.Text = Convert.ToString(dHra);
        dTotal = dbasic + dHra;
        TextBoxTOTAL.Text = Convert.ToString(dTotal);
    }
    protected void ButtonSAVE_Click(object sender, EventArgs e)
    {
        string ConnectionString= ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString;
        string insertsql = "insert into LeaveDay(name,basic,leave,hra,total)values(@name,@basic,@leave,@hra,@total)";
        using (SqlConnection myconnection = new SqlConnection(ConnectionString))
        {
            myconnection.Open();
            SqlCommand mycommand = new SqlCommand(insertsql,myconnection);

            mycommand.Parameters.AddWithValue("@name",TextBoxNAME.Text);
            mycommand.Parameters.AddWithValue("@basic",TextBoxBASIC.Text);
            mycommand.Parameters.AddWithValue("@leave",TextBoxLEAVE.Text);
   mycommand.Parameters.AddWithValue("@hra",TextBoxHRA.Text);
            mycommand.Parameters.AddWithValue("@total",TextBoxTOTAL.Text);

            mycommand.ExecuteNonQuery();
            myconnection.Close();
        }
        TextBoxNAME.Text = string.Empty;
        TextBoxBASIC.Text = string.Empty;
        TextBoxLEAVE.Text = string.Empty;
        TextBoxHRA.Text = string.Empty;
        TextBoxTOTAL.Text = string.Empty;
        }
}