コード例 #1
0
ファイル: GxBiTichChiTiet.cs プロジェクト: Vocaoson/qlgx
        public void InChungNhan()
        {
            if (this.CurrentRow == null || (this.CurrentRow.DataRow as DataRowView) == null)
            {
                return;
            }
            DataRow row = (this.CurrentRow.DataRow as DataRowView).Row;

            GxGiaoDanList.InChungNhanBiTich((int)row[GiaoDanConst.MaGiaoDan], loaiBiTich);
        }
コード例 #2
0
ファイル: GxGiaDinhList.cs プロジェクト: Vocaoson/qlgx
        private void item4_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (this.CurrentRow == null || (this.CurrentRow.DataRow as DataRowView) == null)
                {
                    return;
                }
                DataRow row = (this.CurrentRow.DataRow as DataRowView).Row;
                string  sql = string.Format(SqlConstants.SELECT_THANHVIEN_GIADINH_LIST + " AND ThanhVienGiaDinh.MaGiaDinh={0} ORDER BY VaiTro ASC",
                                            row[GiaDinhConst.MaGiaDinh]);
                DataTable             tbl        = Memory.GetData(sql);
                Dictionary <int, int> danhSachIn = new Dictionary <int, int>();
                if (tbl != null && tbl.Rows.Count > 0)
                {
                    foreach (DataRow r in tbl.Rows)
                    {
                        danhSachIn.Add((int)r[GiaoDanConst.MaGiaoDan], (int)r[ThanhVienGiaDinhConst.VaiTro]);
                    }
                    GxGiaoDanList.XuatLyLichCaNhan(danhSachIn);
                    MessageBox.Show(string.Format("Xuất lý lịch cá nhân các thành viên trong gia đình thành công!\r\nTổng cộng {0} thành viên.", tbl.Rows.Count), "Thông báo", MessageBoxButtons.OK);
                }
                else
                {
                    MessageBox.Show("hông có thành viên nào trong gia đình", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
            }
            catch (Exception ex)
            {
                Memory.ShowError(ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Arrow;
            }
        }
コード例 #3
0
        public void AssignControlData(DataRow row)
        {
            id = (int)row[GiaoDanConst.MaGiaoDan];
            txtMaGiaoDan.Text         = id.ToString();
            txtLinhMucRuaToi.Text     = row[GiaoDanConst.ChaRuaToi].ToString();
            txtLinhMucRuocLe.Text     = row[GiaoDanConst.ChaRuocLe].ToString();
            txtLinhMucThemSuc.Text    = row[GiaoDanConst.ChaThemSuc].ToString();
            chkConHoc.Checked         = (bool)row[GiaoDanConst.ConHoc];
            txtHoTen.Text             = row[GiaoDanConst.HoTen].ToString();
            dtNgayRuaToi.Value        = row[GiaoDanConst.NgayRuaToi];
            dtNgayRuocLe.Value        = row[GiaoDanConst.NgayRuocLe];
            dtNgaySinh.Value          = row[GiaoDanConst.NgaySinh];
            dtNgayThemSuc.Value       = row[GiaoDanConst.NgayThemSuc];
            dtNgayQuaDoi.Value        = row[GiaoDanConst.NgayQuaDoi];
            cbNgheNghiep.SelectedText = row[GiaoDanConst.NgheNghiep].ToString();
            txtNguoiDoDauRuaToi.Text  = row[GiaoDanConst.NguoiDoDauRuaToi].ToString();
            txtNguoiDoDauThemSuc.Text = row[GiaoDanConst.NguoiDoDauThemSuc].ToString();
            txtNoiRuaToi.Text         = row[GiaoDanConst.NoiRuaToi].ToString();
            txtNoiRuocLe.Text         = row[GiaoDanConst.NoiRuocLe].ToString();
            txtNoiSinh.Text           = row[GiaoDanConst.NoiSinh].ToString();
            txtNoiThemSuc.Text        = row[GiaoDanConst.NoiThemSuc].ToString();
            cbPhai.SelectedText       = row[GiaoDanConst.Phai].ToString();
            chkQuaDoi.Checked         = (bool)row[GiaoDanConst.QuaDoi];
            txtTenThanh.Text          = row[GiaoDanConst.TenThanh].ToString();
            cbVanHoa.SelectedText     = row[GiaoDanConst.TrinhDoVanHoa].ToString();
            cbGiaoHo.SelectedValue    = row[GiaoDanConst.MaGiaoHo];
            txtDienThoai.Text         = row[GiaoDanConst.DienThoai].ToString();
            txtEmail.Text             = row[GiaoDanConst.Email].ToString();
            txtSoRuaToi.Text          = row[GiaoDanConst.SoRuaToi].ToString();
            txtSoRuocLe.Text          = row[GiaoDanConst.SoRuocLe].ToString();
            txtSoThemSuc.Text         = row[GiaoDanConst.SoThemSuc].ToString();
            txtGhiChu.Text            = row[GiaoDanConst.GhiChu].ToString();

            txtTenCha.Text         = row[GiaoDanConst.HoTenCha].ToString();
            txtTenMe.Text          = row[GiaoDanConst.HoTenMe].ToString();
            chkDaCoGiaDinh.Checked = (bool)row[GiaoDanConst.DaCoGiaDinh];
            chkGiaoDanAo.Checked   = (bool)row[GiaoDanConst.GiaoDanAo];
            chkTanTong.Checked     = (bool)row[GiaoDanConst.TanTong];

            if (row[ChuyenXuConst.LoaiChuyen] != DBNull.Value)
            {
                cbChuyenXu.SelectedValue = int.Parse(row[ChuyenXuConst.LoaiChuyen].ToString());
            }
            if (row[ChuyenXuConst.NgayChuyen] != DBNull.Value)
            {
                dtNgayChuyen.Value = row[ChuyenXuConst.NgayChuyen];
            }
            if (row[ChuyenXuConst.NoiChuyen] != DBNull.Value)
            {
                txtGiaoXuChuyen.Text = row[ChuyenXuConst.NoiChuyen].ToString();
            }
            if (row[ChuyenXuConst.GhiChuChuyen] != DBNull.Value)
            {
                txtGhiChuChuyenXu.Text = row[ChuyenXuConst.GhiChuChuyen].ToString();
            }

            if ((bool)row[GiaoDanConst.DaXoa])
            {
                chkDelete.Checked = (bool)row[GiaoDanConst.DaXoa];
                chkDelete.Visible = true;
            }
            //find TenCha, TenMe if not exist in GiaoDan Table
            //Dictionary<int, string> chaMe = GXGiaDinhList.GetTenChaMe(Id, row[GiaoDanConst.HoTenCha].ToString(), row[GiaoDanConst.HoTenMe].ToString());
            //txtTenCha.Text = chaMe[GXConstants.VAITRO_CHONG];
            //txtTenMe.Text = chaMe[GXConstants.VAITRO_VO];

            if (rowGiaDinh == null)
            {
                rowGiaDinh = GxGiaDinhList.GetRowGiaDinh(id, GxConstants.VAITRO_CON);
            }
            if (rowGiaDinh != null)
            {
                if (txtTenCha.Text.Trim() == "")
                {
                    txtTenCha.Text = rowGiaDinh[GiaDinhConst.TenChong].ToString();
                }
                txtTenCha.DisplayMode = DisplayMode.Mode2;
                //txtTenCha.ReadOnly = true;
                //txtTenCha.EditControl.SelectButton.Visible = false;
                //txtTenCha.TextBox.Width = txtNoiSinh.TextBox.Width;
                if (txtTenMe.Text.Trim() == "")
                {
                    txtTenMe.Text = rowGiaDinh[GiaDinhConst.TenVo].ToString();
                }
                txtTenMe.DisplayMode = DisplayMode.Mode2;
                //txtTenMe.ReadOnly = true;
                //txtTenMe.EditControl.SelectButton.Visible = false;
                //txtTenMe.TextBox.Width = txtNoiSinh.TextBox.Width;
            }
            if (GxGiaoDanList.DaCoThongTinHonPhoi(id))
            {
                chkDaCoGiaDinh.Checked = true;
                chkDaCoGiaDinh.Enabled = false;
            }

            txtGiaoXu.Text        = row[GiaoDanConst.ThuocGiaoXu].ToString();
            txtGiaoPhan.Text      = row[GiaoDanConst.ThuocGiaoPhan].ToString();
            txtDiaChi.Text        = row[GiaoDanConst.DiaChi].ToString();
            cbDanToc.SelectedText = row[GiaoDanConst.DanToc].ToString();
            txtNoiQuaDoi.Text     = row[GiaoDanConst.NoiQuaDoi].ToString();
            txtSoAnTang.Text      = row[GiaoDanConst.SoAnTang].ToString();
            txtNoiAnTang.Text     = row[GiaoDanConst.NoiAnTang].ToString();

            currentRow = row;
        }