예제 #1
0
        protected void ddl_Rent_SelectedIndexChanged(object sender, EventArgs e)
        {
            decimal     bikeRent = 0;
            List <Rent> Obj_Rent = Rental_BAL.GetRentDetails(ddl_RentID.SelectedValue);

            if (Obj_Rent != null && Obj_Rent.Count > 0)
            {
                for (int i = 0; i < Obj_Rent.Count; i++)
                {
                    List <Customer> Obj_Customer = Customer_BAL.GetCustomerDetails(Obj_Rent[i].CustomerID.ToString());
                    if (Obj_Customer != null && Obj_Customer.Count > 0)
                    {
                        for (int k = 0; k < Obj_Customer.Count; k++)
                        {
                            txtCustomerName.Text = Obj_Customer[k].FirstName;
                        }
                    }

                    List <Bike> Obj_Bike = Bike_BAL.GetBikeDetails(Obj_Rent[i].BikeID.ToString());
                    if (Obj_Bike != null && Obj_Bike.Count > 0)
                    {
                        for (int j = 0; j < Obj_Bike.Count; j++)
                        {
                            txtBikeModel.Text = Obj_Bike[j].Model;
                            bikeRent          = Convert.ToDecimal(Obj_Bike[j].RentPerDay);
                        }
                    }
                    txtIssueDate.Text  = Obj_Rent[i].IssueDate.ToString();
                    txtReturnDate.Text = DateTime.Now.ToString();
                    DateTime issuedate = Convert.ToDateTime(Obj_Rent[i].IssueDate);
                    double   days      = (DateTime.Now - issuedate).TotalDays;
                    txtTotalRent.Text = (bikeRent * Convert.ToDecimal(Math.Round(days))).ToString();
                }
            }
        }
예제 #2
0
        protected void ddl_Bike_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <Bike> Obj_Bike = Bike_BAL.GetBikeDetails(ddl_Bike.SelectedValue);

            if (Obj_Bike != null && Obj_Bike.Count > 0)
            {
                for (int i = 0; i < Obj_Bike.Count; i++)
                {
                    txtBikeModel.Text = Obj_Bike[i].Model;
                }
            }
        }
예제 #3
0
        protected void ddl_Bike_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <Bike> Obj_Bike = Bike_BAL.GetBikeDetails(ddl_Bike.SelectedValue);

            if (Obj_Bike != null && Obj_Bike.Count > 0)
            {
                for (int i = 0; i < Obj_Bike.Count; i++)
                {
                    txtBikeModel.Text          = Obj_Bike[i].Model;
                    txtBikeMaker.Text          = Obj_Bike[i].Maker;
                    txtRegistrationNumber.Text = Obj_Bike[i].RegistrationNumber;
                    txtRentPerDay.Text         = Obj_Bike[i].RentPerDay.ToString();
                }
            }
        }