Exemplo n.º 1
0
        public void getRoomersServices()
        {
            try
            {
                using (OracleConnection connection = new OracleConnection(OracleDatabaseConnection.str2))
                {
                    connection.Open();
                    OracleParameter room = new OracleParameter
                    {
                        ParameterName = "roomer",
                        Direction     = ParameterDirection.Output,
                        OracleDbType  = OracleDbType.RefCursor
                    };

                    using (OracleCommand command = new OracleCommand("admin.getRoomers"))
                    {
                        command.Connection  = connection;
                        command.CommandType = CommandType.StoredProcedure;
                        command.Parameters.AddRange(new OracleParameter[] { room });
                        var       reader = command.ExecuteReader();
                        DataTable dt     = new DataTable();
                        dt.Load(reader);

                        foreach (DataRow row in dt.Rows)
                        {
                            string Surname           = row["Client_Sur"].ToString();
                            string Name              = row["Client_Name"].ToString();
                            string Secondname        = row["Client_Secon"].ToString();
                            string PassportId        = row["PassportId"].ToString();
                            string DateOfBirthday    = Convert.ToDateTime(row["DateOfBirth"]).ToString("D");
                            string PhoneNumber       = row["PhoneNumber"].ToString();
                            int    NumberOfApartment = Convert.ToInt32(row["NumberOfApartment"]);
                            string Category          = row["Category"].ToString();
                            int    CountsOfSeats     = Convert.ToInt32(row["CountsOfSeats"]);
                            string ArrivalDate       = Convert.ToDateTime(row["ArrivalDate"]).ToString("D");
                            string DateOfDeparture   = Convert.ToDateTime(row["DateOfDeparture"]).ToString("D");
                            string SurnameEmp        = row["Employee_Sur"].ToString();
                            string NameEmp           = row["Employee_Name"].ToString();
                            string SecondnameEmp     = row["Employee_Secon"].ToString();
                            string Servicee          = row["Service"].ToString();
                            double ServiceFee        = Convert.ToDouble(row["ServiceFee"]);
                            double AccomodationFee   = Convert.ToDouble(row["AccomodationFee"]);
                            roomer = new Roomer(Surname, Name, Secondname, PassportId, DateOfBirthday,
                                                PhoneNumber, NumberOfApartment, Category, CountsOfSeats, ArrivalDate,
                                                DateOfDeparture, SurnameEmp, NameEmp, SecondnameEmp, Servicee, ServiceFee,
                                                AccomodationFee);
                            all_roomers.Add(roomer);
                        }
                    }
                }
            }

            catch (OracleException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 public Prolongation(Roomer roomer)
 {
     InitializeComponent();
     current_roomer                = roomer;
     surnameClient.Text            = roomer.Surname;
     nameClient.Text               = roomer.Name;
     secondNameClient.Text         = roomer.Secondname;
     newDeparture.DisplayDateStart = Convert.ToDateTime(roomer.DateOfDeparture).AddDays(1);
     getClientId();
 }
Exemplo n.º 3
0
        public RoomerModel(Roomer roomer)
        {
            RoomerId    = roomer.Id;
            Country     = roomer.House.Country;
            City        = roomer.House.City;
            Street      = roomer.House.Street;
            HouseNumber = roomer.House.HouseNumber;
            RoomNumber  = roomer.Number;
            HouseId     = roomer.House.Id;

            Workers = roomer.House.Workers;
            Tasks   = roomer.Tasks;
        }
Exemplo n.º 4
0
 public Payment(Roomer roomer)
 {
     InitializeComponent();
     this.currentRoomer    = roomer;
     surnameClient.Text    = roomer.Surname;
     nameClient.Text       = roomer.Name;
     secondNameClient.Text = roomer.Secondname;
     phone.Text            = roomer.PhoneNumber;
     dateb.Text            = roomer.DateOfBirthday;
     numb.Text             = roomer.NumberOfApartment.ToString();
     categ.Text            = roomer.Category;
     countsofseats.Text    = roomer.CountsOfSeats.ToString();
     arrival.Text          = roomer.ArrivalDate;
     depart.Text           = roomer.DateOfDeparture;
     surnameEmp.Text       = roomer.SurnameEmp;
     nameEmp.Text          = roomer.NameEmp;
     secondNameEmp.Text    = roomer.SecondnameEmp;
     serv.Text             = roomer.Service;
     servfee.Text          = roomer.ServiceFee + " руб.";
     accomofee.Text        = roomer.AccomodationFee + " руб.";
     total.Text            = Convert.ToString(Sum(roomer.ServiceFee, roomer.AccomodationFee)) + " руб.";
 }