private void areasDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (areasDataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
     {
         areasDataGridView.CurrentRow.Selected = true;
         //MessageBox.Show(areasDataGridView.Rows[e.RowIndex].Cells["id"].FormattedValue.ToString());
         SelectedArea.area_id   = (int)areasDataGridView.Rows[e.RowIndex].Cells["id"].Value;
         SelectedArea.person_id = (int)areasDataGridView.Rows[e.RowIndex].Cells["Owner_id"].Value;
         SelectedArea.areaName  = areasDataGridView.Rows[e.RowIndex].Cells["AreaName"].Value.ToString();
         SelectedArea.areaSpace = (int)areasDataGridView.Rows[e.RowIndex].Cells["SpaceOfArea_squareMeter"].Value;
         SelectedArea.price     = (int)areasDataGridView.Rows[e.RowIndex].Cells["PricePerMonth"].Value;
         SelectedArea.rooms     = (int)areasDataGridView.Rows[e.RowIndex].Cells["Rooms"].Value;
         SelectedArea.describe  = areasDataGridView.Rows[e.RowIndex].Cells["Describe"].Value.ToString();
         if (data.Contains(SelectedArea.area_id.ToString()))
         {
             SelectedArea.areaType = "request";
         }
         else
         {
             SelectedArea.areaType = "normal";
         }
         this.Hide();
         Extended_inf Extended_inf = new Extended_inf();
         Extended_inf.Show();
     }
 }
Esempio n. 2
0
        private void leasingAppIDDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            leasingAppIDDataGridView.CurrentRow.Selected = true;
            //MessageBox.Show(areasDataGridView.Rows[e.RowIndex].Cells["id"].FormattedValue.ToString());
            SelectedArea.area_id   = (int)leasingAppIDDataGridView.Rows[e.RowIndex].Cells["id"].Value;
            SelectedArea.person_id = (int)leasingAppIDDataGridView.Rows[e.RowIndex].Cells["Renter_id"].Value;
            SelectedArea.areaName  = leasingAppIDDataGridView.Rows[e.RowIndex].Cells["LeasingAppName"].Value.ToString();
            SelectedArea.areaSpace = (int)leasingAppIDDataGridView.Rows[e.RowIndex].Cells["SpaceSquare"].Value;
            SelectedArea.price     = (int)leasingAppIDDataGridView.Rows[e.RowIndex].Cells["PricePerMonth"].Value;
            SelectedArea.rooms     = (int)leasingAppIDDataGridView.Rows[e.RowIndex].Cells["Rooms"].Value;
            SelectedArea.describe  = leasingAppIDDataGridView.Rows[e.RowIndex].Cells["Describe"].Value.ToString();
            this.Hide();
            Extended_inf Extended_inf = new Extended_inf();

            Extended_inf.Show();
        }
        private void RequestsGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (RequestsGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null)
            {
                RequestsGridView.CurrentRow.Selected = true;

                //MessageBox.Show(areasDataGridView.Rows[e.RowIndex].Cells["id"].FormattedValue.ToString());
                SelectedArea.area_id   = int.Parse(RequestsGridView.Rows[e.RowIndex].Cells["id_a"].Value.ToString());
                SelectedArea.person_id = int.Parse(RequestsGridView.Rows[e.RowIndex].Cells["id_own"].Value.ToString());
                SelectedArea.areaName  = RequestsGridView.Rows[e.RowIndex].Cells["Area_Name"].Value.ToString();
                SelectedArea.areaSpace = int.Parse(RequestsGridView.Rows[e.RowIndex].Cells["square"].Value.ToString());
                SelectedArea.price     = int.Parse(RequestsGridView.Rows[e.RowIndex].Cells["price_perMonth"].Value.ToString());
                SelectedArea.rooms     = int.Parse(RequestsGridView.Rows[e.RowIndex].Cells["roomsAmount"].Value.ToString());
                SelectedArea.describe  = RequestsGridView.Rows[e.RowIndex].Cells["descr"].Value.ToString();
                SelectedArea.accept    = bool.Parse(RequestsGridView.Rows[e.RowIndex].Cells["Accept"].Value.ToString());
                SelectedArea.areaType  = "UsersRequest";

                this.Hide();
                Extended_inf Extended_inf = new Extended_inf();
                Extended_inf.Show();
            }
        }