Пример #1
0
        public DataTable GetSource()
        {
            string        conStr = GetConnection.GetConnectionString();
            SqlConnection con    = new SqlConnection(conStr);

            SqlDataReader dr;
            SqlCommand    cmd;
            DataTable     dt = new DataTable();
            string        query;

            con.Open();
            query           = "prc_SelectSource";
            cmd             = new SqlCommand(query, con);
            cmd.CommandType = CommandType.StoredProcedure;
            dr = cmd.ExecuteReader();
            dt.Load(dr);
            con.Close();
            return(dt);
        }
Пример #2
0
        public DataTable GetDestination(string selectedSource)
        {
            string        conStr = GetConnection.GetConnectionString();
            SqlConnection con    = new SqlConnection(conStr);

            SqlDataReader dr;
            SqlCommand    cmd;
            DataTable     dt = new DataTable();
            string        query;

            con.Open();
            query           = "prc_SelectDestination";
            cmd             = new SqlCommand(query, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@source", selectedSource);
            dr = cmd.ExecuteReader();
            dt.Load(dr);
            con.Close();
            return(dt);
        }
Пример #3
0
        public int updatePassengersBeforePayment(int PassengerId,
                                                 string ReferenceId,
                                                 string PassengerName,
                                                 int PassengerAge,
                                                 char PassengerGender,
                                                 string BookingStatus)
        {
            SqlConnection con = new SqlConnection();

            con.ConnectionString = GetConnection.GetConnectionString();
            SqlCommand cmd;
            int        cnt = 0;

            try
            {
                //Establish connection with db

                con.Open();


                string query1 = "prc_InsertPassengersBeforePayment";
                cmd             = new SqlCommand(query1, con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@PassengerId", PassengerId);
                cmd.Parameters.AddWithValue("@ReferenceId", ReferenceId);
                cmd.Parameters.AddWithValue("@PassengerName", PassengerName);
                cmd.Parameters.AddWithValue("@PassengerAge", PassengerAge);
                cmd.Parameters.AddWithValue("@PassengerGender", PassengerGender);
                cmd.Parameters.AddWithValue("@BookingStatus", BookingStatus);


                cnt = cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }

            return(cnt);
        }
Пример #4
0
        public void CancelTicket(int PassengerId, string ReferenceId, string user)
        {
            try
            {
                SqlConnection con = new SqlConnection();
                con.ConnectionString = GetConnection.GetConnectionString();
                con.Open();
                SqlCommand cmd;

                string query1 = "prc_UpdateCancelledStatus";
                cmd             = new SqlCommand(query1, con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@PassengerId", PassengerId);
                cmd.Parameters.AddWithValue("@ReferenceId", ReferenceId);
                cmd.Parameters.AddWithValue("@user", user);

                int cnt = cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception) { }
        }
        public DataTable ViewBookingHistory(string CustomerId)
        {
            DataTable     dt  = new DataTable();
            SqlConnection con = new SqlConnection();

            con.ConnectionString = GetConnection.GetConnectionString();
            con.Open();
            SqlDataReader dr;
            SqlCommand    cmd;

            string query1 = "prc_BookingHistory";

            cmd             = new SqlCommand(query1, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@CustomerId", CustomerId);

            dr = cmd.ExecuteReader();
            dt.Load(dr);
            con.Close();
            return(dt);
        }
        }//checkEmail

        public int SettingNewPassword(string EmailId, string pwd)
        {
            int n = 0;

            SqlConnection con = new SqlConnection();

            con.ConnectionString = GetConnection.GetConnectionString();
            SqlCommand cmd;

            try
            {
                //Establish connection with db

                con.Open();


                string query1 = "Prc_SetNewUserPassword";
                cmd             = new SqlCommand(query1, con);
                cmd.CommandType = CommandType.StoredProcedure;



                cmd.Parameters.AddWithValue("@EmailId", EmailId);
                cmd.Parameters.AddWithValue("@NewPwd", pwd);



                n = cmd.ExecuteNonQuery();



                //int j=Convert.ToInt32(cmd.ExecuteScalar());
            }

            catch (Exception)
            {
            }

            return(n);
        }
Пример #7
0
        public DataTable GetPassengers(string ReferenceId)
        {
            DataTable dtPassengers = new DataTable();

            SqlConnection con = new SqlConnection();

            con.ConnectionString = GetConnection.GetConnectionString();
            SqlDataReader dr;
            SqlCommand    cmd;

            con.Open();
            string query1 = "prc_GetPassengerData";

            cmd             = new SqlCommand(query1, con);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@ReferenceId", ReferenceId);

            dr = cmd.ExecuteReader();
            dtPassengers.Load(dr);
            con.Close();
            return(dtPassengers);
        }