Ejemplo n.º 1
0
        private void giấyTờToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormGiayTo formGiayTo = new FormGiayTo();

            formGiayTo.TopLevel        = false;
            formGiayTo.Visible         = true;
            formGiayTo.FormBorderStyle = FormBorderStyle.None;
            formGiayTo.Dock            = DockStyle.Fill;
            tabCtlChinh.TabPages.Add("Giấy tờ");
            tabCtlChinh.TabPages[tabCtlChinh.TabPages.Count - 1].Controls.Add(formGiayTo);
            tabCtlChinh.SelectedIndex = tabCtlChinh.TabPages.Count - 1;
        }
Ejemplo n.º 2
0
 private void btnGiayTo_Click(object sender, EventArgs e)
 {
     if (id != "")
     {
         FormGiayTo dialogGiayTo = new FormGiayTo(txtMaDiaOc.Text.ToString());
         dialogGiayTo.StartPosition = FormStartPosition.CenterScreen;
         if (dialogGiayTo.ShowDialog(this) == DialogResult.Yes)
         {
         }
         else
         {
             //       txtSoLuongQuangCao.Text = chiTietQuangCaoBLL.LayDanhSachChiTietQuangCaoTheoMaPhieuDangKy(Int32.Parse(txtMaPhieuDangKy.Text)).Rows.Count.ToString();
         }
     }
     else
     {
         MessageBox.Show("Vui lòng chọn địa ốc muốn xem giấy tờ!");
     }
 }
Ejemplo n.º 3
0
        private void dgvDiaOc_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                try
                {
                    DataGridViewRow row         = dgvDiaOc.Rows[e.RowIndex];
                    int             columnIndex = dgvDiaOc.CurrentCell.ColumnIndex;
                    string          columnName  = dgvDiaOc.Columns[columnIndex].Name;
                    maDiaOc = Int32.Parse(row.Cells["MaDiaOc"].Value.ToString());

                    if (columnName.Equals("XemGiayTo"))
                    {
                        FormGiayTo diaglogGiayTo = new FormGiayTo(maDiaOc.ToString());
                        diaglogGiayTo.StartPosition = FormStartPosition.CenterScreen;
                        diaglogGiayTo.ShowDialog(this);
                    }
                    btnHinhAnh.Text               = "Hình ảnh của Địa ốc số " + maDiaOc;
                    lbChiTietQUangCao.Text        = "Thông tin quảng cáo của Địa ốc số " + maDiaOc;
                    dgvChiTietQuangCao.DataSource = diaOcBLL.LayDanhSachChiTietQuangCao(maDiaOc);
                    if (diaOcBLL.LayDanhSachChiTietQuangCao(maDiaOc).Rows.Count > 0)
                    {
                        DataGridViewRow rowChiTietQUangCao = this.dgvChiTietQuangCao.Rows[0];
                        txtMaChiTietQuangCao.Text = rowChiTietQUangCao.Cells["MaChiTietQuangCao"].Value.ToString();
                        txtMaPhieuDangKy.Text     = rowChiTietQUangCao.Cells["MaPhieuDangKy"].Value.ToString();
                        txtTenLoaiQuangCao.Text   = rowChiTietQUangCao.Cells["TenLoaiQuangCao"].Value.ToString();
                        txtTenVitri.Text          = rowChiTietQUangCao.Cells["MaViTri"].Value.ToString();
                        txtTenBao.Text            = rowChiTietQUangCao.Cells["MaBao"].Value.ToString();
                        txtSoLuong.Text           = rowChiTietQUangCao.Cells["SoLuongPhatHanh"].Value.ToString();

                        if (rowChiTietQUangCao.Cells["TrangThaiKiemDuyet1"].Value.ToString().Equals("1"))
                        {
                            rbDaKiemDuyet.Checked = true;
                        }
                        else
                        {
                            rbChuaKiemDuyet.Checked = true;
                        }
                        if (rowChiTietQUangCao.Cells["NgayBatDau"].Value.ToString() != "")
                        {
                            dtpNgayBatDau.Value = Convert.ToDateTime(rowChiTietQUangCao.Cells["NgayBatDau"].Value.ToString());
                        }
                        if (rowChiTietQUangCao.Cells["NgayKetThuc"].Value.ToString() != "")
                        {
                            dtpNgayKetThuc.Value = Convert.ToDateTime(rowChiTietQUangCao.Cells["NgayKetThuc"].Value.ToString());
                        }
                        txtKichThuoc.Text = rowChiTietQUangCao.Cells["KichThuoc"].Value.ToString();
                        if (txtTenLoaiQuangCao.Text.ToString() == "Quảng cáo tờ bướm")
                        {
                            double ChiPhi = Double.Parse(chiTietQuangCaoBLL.LayDonGiaTheoMa_ToBuom(Int32.Parse(txtMaChiTietQuangCao.Text)).Rows[0]["DonGia"].ToString()) * Double.Parse(txtSoLuong.Text);
                            txtChiPhi.Text = String.Format("{0:#,###0}", ChiPhi.ToString() + " VNĐ" + " (" + txtSoLuong.Text + " tờ)");
                        }
                        else
                        {
                            double ChiPhi = Double.Parse(chiTietQuangCaoBLL.LayDonGiaTheoMa_LoaiKhac(Int32.Parse(txtMaChiTietQuangCao.Text)).Rows[0]["DonGia"].ToString());
                            txtChiPhi.Text = String.Format("{0:#,###0}", ChiPhi.ToString() + " VNĐ");
                        }
                    }
                    else
                    {
                        txtChiPhi.Text = txtKichThuoc.Text = txtMaChiTietQuangCao.Text = txtMaPhieuDangKy.Text = txtSoLuong.Text = txtTenBao.Text = txtTenLoaiQuangCao.Text = txtTenVitri.Text = "";
                    }
                }

                catch
                {
                }
            }
        }