Esempio n. 1
0
        private void selectLogic()
        {
            try
            {
                DataTable dt = null;
                dt = wDm.SelectFloorPlan(item_cd.Text);

                if (dt != null && dt.Rows.Count > 0)
                {
                    this.dgv_picture.RowCount = dt.Rows.Count;

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dgv_picture.Rows[i].Cells["IMG_NAME"].Value   = dt.Rows[i]["IMG_NAME"].ToString();
                        dgv_picture.Rows[i].Cells["SEQ"].Value        = dt.Rows[i]["INPUT_CD"].ToString();
                        dgv_picture.Rows[i].Cells["INPUT_DATE"].Value = dt.Rows[i]["INPUT_DATE"].ToString();
                        dgv_picture.Rows[i].Cells[2].Value            = "사진추가";


                        byte[] ip      = (byte[])dt.Rows[i]["IMG"];
                        Image  a       = ByteImg(ip);
                        Image  cus_img = pic_resize_logic(dgv_picture, a);
                        dgv_picture.Rows[i].Height   = 194;
                        dgv_picture.Columns[1].Width = 300;


                        //dgv_picture.Rows[i].Cells["IMG_SIZE"].Value = "0";
                        dgv_picture.Rows[i].Cells["PICTURE"].Value  = cus_img;
                        dgv_picture.Rows[i].Cells["IMG_SIZE"].Value = dt.Rows[i]["IMG_PATH"].ToString();
                        dgv_picture.Rows[i].Cells["PIC_PATH"].Value = ip;

                        //dgv_picture.Rows[e.RowIndex].Cells["PIC_PATH"].Value = img;
                    }
                }

                else
                {
                    //MessageBox.Show("데이터가 없습니다");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 2
0
        private void dgv_floorPlan_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            lbl_gbn.Text           = "0";
            dtp_input_date.Enabled = false;
            DataTable dt = new DataTable();

            try
            {
                dt = wDm.SelectFloorPlan(dgv_floorPlan.Rows[e.RowIndex].Cells["INPUT_DATE"].Value.ToString(), dgv_floorPlan.Rows[e.RowIndex].Cells["INPUT_CD"].Value.ToString());

                dtp_input_date.Text = dgv_floorPlan.Rows[e.RowIndex].Cells["INPUT_DATE"].Value.ToString();
                txt_input_cd.Text   = dgv_floorPlan.Rows[e.RowIndex].Cells["INPUT_CD"].Value.ToString();
                txtFloorPlanNm.Text = dt.Rows[0]["IMG_NAME"].ToString();
                txt_comment.Text    = dt.Rows[0]["COMMENT"].ToString();
                img_size            = int.Parse(dt.Rows[0]["IMG_PATH"].ToString());

                if (dt.Rows[0]["IMG"] != null && !dt.Rows[0]["IMG"].ToString().Equals(""))
                {
                    ip = (byte[])dt.Rows[0]["IMG"];

                    Image img = null;

                    if (ip.Length < 2)
                    {
                        pictureBox1.BackgroundImage = null;
                    }
                    else
                    {
                        Image a = ByteImg(ip);

                        img = ComInfo.pic_resize_logic(pictureBox1, a);
                        pictureBox1.BackgroundImage = img;
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }