public void InsertCarParkingEntry(CarParkingInfo carParkingInfo)
        {
            ParkingManagementDAL parkingManagementDAL = new ParkingManagementDAL();

            parkingManagementDAL.InsertCarParkingEntry(carParkingInfo);
            parkingManagementDAL = null;
        }
        public void ParkingOutGet(CarParkingInfo carParkingInfo)
        {
            using (SqlConnection connection = new SqlConnection(connetionString))
            {
                connection.Open();
                string     spName     = "spParkingOutGet";
                SqlCommand sqlCommand = new SqlCommand(spName, connection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter[] spParameters = new SqlParameter[]
                {
                    new SqlParameter("@ID", carParkingInfo.ID),
                    new SqlParameter("@OutDate", carParkingInfo.OutDate),
                    new SqlParameter("@StayTime", carParkingInfo.StayTime),
                    new SqlParameter("@TotalPrice", carParkingInfo.TotalPrice),
                    new SqlParameter("@LocationInfo", carParkingInfo.LocationInfo)
                };

                sqlCommand.Parameters.AddRange(spParameters);
                sqlCommand.ExecuteNonQuery();
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         CarParkingInfo carParkingInfo = new CarParkingInfo();
         carParkingInfo.SubscriberID     = Convert.ToInt32((cmbBoxUsers.SelectedItem as ComboboxItem).Value);
         carParkingInfo.ScheduleID       = Convert.ToInt32((cmbBoxSchedules.SelectedItem as ComboboxItem).Value);
         carParkingInfo.CarPlate         = txtPlate.Text;
         carParkingInfo.EntryDate        = dtPickerEntryDate.Value;
         carParkingInfo.RegistrationDate = DateTime.Now;
         carParkingInfo.LocationInfo     = locationInfo;
         carParkingInfo.IsActive         = 1;
         ParkingManagementBLL parkingManagementBLL = new ParkingManagementBLL();
         parkingManagementBLL.InsertCarParkingEntry(carParkingInfo);
         MessageBox.Show("Araç girişi yapıldı!");
         this.Close();
     }
     catch (Exception ex)
     {
         Log.AddExceptionLog(ex);
         MessageBox.Show("Araç girişi yapılırken hata oluştu!");
     }
 }
        public CarParkingInfo GetCarParkingInfo(int locationInfo)
        {
            CarParkingInfo carParkingInfo = new CarParkingInfo();

            using (SqlConnection connection = new SqlConnection(connetionString))
            {
                connection.Open();
                string     spName     = "spGetCarParkingInfo";
                SqlCommand sqlCommand = new SqlCommand(spName, connection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                sqlCommand.Parameters.Add(new SqlParameter("@LocationInfo", locationInfo));
                SqlDataReader dr = sqlCommand.ExecuteReader();
                if (dr.Read())
                {
                    carParkingInfo.ID            = Convert.ToInt32(dr["ID"]);
                    carParkingInfo.EntryDate     = Convert.ToDateTime(dr["GIRIS_TARIHI"]);
                    carParkingInfo.SchedulePrice = float.Parse(dr["TARIFE_UCRETI"].ToString());
                }

                return(carParkingInfo);
            }
        }
        public void InsertCarParkingEntry(CarParkingInfo carParkingInfo)
        {
            using (SqlConnection connection = new SqlConnection(connetionString))
            {
                connection.Open();
                string     spName     = "spInsertCarParkingEntry";
                SqlCommand sqlCommand = new SqlCommand(spName, connection);
                sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;

                SqlParameter[] spParameters = new SqlParameter[]
                {
                    new SqlParameter("@SubscriberID", carParkingInfo.SubscriberID),
                    new SqlParameter("@ScheduleID", carParkingInfo.ScheduleID),
                    new SqlParameter("@CarPlate", carParkingInfo.CarPlate),
                    new SqlParameter("@EntryDate", carParkingInfo.EntryDate),
                    new SqlParameter("@RegistrationDate", carParkingInfo.RegistrationDate),
                    new SqlParameter("@LocationInfo", carParkingInfo.LocationInfo),
                    new SqlParameter("@IsActive", carParkingInfo.IsActive)
                };

                sqlCommand.Parameters.AddRange(spParameters);
                sqlCommand.ExecuteNonQuery();
            }
        }
 public void GetCarParkingInfo(int locationInfo)
 {
     carParkingInfo          = parkingManagementBLL.GetCarParkingInfo(locationInfo);
     dtPickerEntryDate.Value = carParkingInfo.EntryDate;
     dtPickerOutDate.MinDate = carParkingInfo.EntryDate;
 }
        public void ParkingOutGet(CarParkingInfo carParkingInfo)
        {
            ParkingManagementDAL parkingManagementDAL = new ParkingManagementDAL();

            parkingManagementDAL.ParkingOutGet(carParkingInfo);
        }