Пример #1
0
        private void dgvVictims_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int rowindex = e.RowIndex;

            txtFullName.Text   = dgvVictims.Rows[rowindex].Cells[0].Value.ToString();
            txtHouseGrade.Text = dgvVictims.Rows[rowindex].Cells[1].Value.ToString();

            //Get photo path First
            string photo = dgvVictims.Rows[rowindex].Cells[5].Value.ToString();

            if (photo != "")
            {
                //Display Image
                pictureBoxProfilePhoto.Image = new Bitmap(photo);
            }

            txtVictimID.Text = dgvVictims.Rows[rowindex].Cells[7].Value.ToString();

            //Now Shwing House Address Based on House ID
            int      house_id = int.Parse(dgvVictims.Rows[rowindex].Cells[6].Value.ToString());
            houseBLL hbd      = hdal.GetDistrictByHouseID(house_id);
            string   district = hbd.district;

            houseBLL hbv = hdal.GetVDCByHouseID(house_id);
            string   vdc = hbv.vdc;

            houseBLL hbw  = hdal.GetWardNoByHouseID(house_id);
            string   ward = hbw.ward_no;

            houseBLL hbt  = hdal.GetToleByHouseID(house_id);
            string   tole = hbt.tole;

            txtAddress.Text = district + ", " + vdc + " - " + ward + ", " + tole;
        }
Пример #2
0
        private void dgvVictims_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int RowIndex = e.RowIndex;

            txtFullName.Text      = dgvVictims.Rows[RowIndex].Cells[0].Value.ToString();
            txtFirstPayment.Text  = dgvVictims.Rows[RowIndex].Cells[1].Value.ToString();
            txtSecondPayment.Text = dgvVictims.Rows[RowIndex].Cells[2].Value.ToString();
            txtThirdPayment.Text  = dgvVictims.Rows[RowIndex].Cells[3].Value.ToString();

            //For Displaying Profile Picture
            string photo = dgvVictims.Rows[RowIndex].Cells[4].Value.ToString();

            if (photo != "")
            {
                //Display Image
                pictureBoxProfilePhoto.Image = new Bitmap(photo);
            }

            //For Displaying House Grade and house Address
            int house_id          = int.Parse(dgvVictims.Rows[RowIndex].Cells[5].Value.ToString());
            houseConditionBLL hcb = hcdal.GetHouseGradeByHouseId(house_id);

            txtHouseGrade.Text = hcb.damage_grade;

            //Dislaying House Address Based on house_id
            houseBLL hbd      = hdal.GetDistrictByHouseID(house_id);
            string   district = hbd.district;

            houseBLL hbv = hdal.GetVDCByHouseID(house_id);
            string   vdc = hbv.vdc;

            houseBLL hbw  = hdal.GetWardNoByHouseID(house_id);
            string   ward = hbw.ward_no;

            houseBLL hbt  = hdal.GetToleByHouseID(house_id);
            string   tole = hbt.tole;

            txtAddress.Text = district + ", " + vdc + " - " + ward + ", " + tole;
        }