Wednesday, August 1, 2018

how to create bus ticket booking Management system | Sradha WebCreations

bus ticket booking  Management system



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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

    }
protected void TextBoxKILOMETER_TextChanged(object sender,EventArgs e)
    {
        string sName = textboxNAME.Text;
        string sSeatNumber = TextBoxseatnumber.Text;
        string sJDate = TextBoxjourning.Text;
        int iKiloMeter = Convert.ToInt32(TextBoxKILOMETER.Text);
       
        double dMinimumCharge;
        int iExtraKilometer;
       
        iExtraKilometer = iKiloMeter - 25;
        TextBoxEXTRAKILOMETER.Text = Convert.ToString(iExtraKilometer);            
        double dExtraCharge;
        double dTotalCharge;
     
        if (iKiloMeter <= 25)
        {
            dMinimumCharge = 25.00;
        
            dExtraCharge = 0;
            dTotalCharge = dMinimumCharge + dExtraCharge;
        }
        else if(iKiloMeter>25 && iKiloMeter<=50)
        {
            dMinimumCharge=25.00;
            dExtraCharge = 15.00;
            dTotalCharge = dMinimumCharge + dExtraCharge;
         }
        else if (iKiloMeter > 50 && iKiloMeter <= 75)
        {
            dMinimumCharge = 25.00;
            dExtraCharge = 15.00+15.00;
            dTotalCharge = dMinimumCharge + dExtraCharge;
        }
        else if (iKiloMeter > 75 && iKiloMeter <= 100)
        {
            dMinimumCharge = 25.00;
            dExtraCharge = 15.00 + 15.00 + 15.00;
            dTotalCharge = dMinimumCharge + dExtraCharge;
        }
        else if (iKiloMeter > 100 && iKiloMeter <= 125)
        {
            dMinimumCharge = 25.00;
            dExtraCharge = 15.00+15.00+15.00+15.00;
            dTotalCharge = dMinimumCharge + dExtraCharge;
        }
        else
        {
            dMinimumCharge = 25.00;
            dExtraCharge = 15.00 + 15.00 + 15.00 + 15.00;
            dTotalCharge = dMinimumCharge + dExtraCharge;
        }
      
 TextBoxMINIMUMCHARGE.Text = Convert.ToString(dMinimumCharge);
        TextBoxEXTRAKILOMETERCHARGE.Text = Convert.ToString(dExtraCharge);
        TextBoxTOTALCHARGE.Text = Convert.ToString(dTotalCharge);
        }
   
}





No comments:

Post a Comment