Exemplo n.º 1
0
        protected void btnLuuChu_Click(object sender, EventArgs e)
        {
            bool HoSoChinhThuc = false;

            if (Session["LoaiHoSo"] == "DuBi")
            {
                HoSoChinhThuc = false;
            }
            else if (Session["LoaiHoSo"] == "ChinhThuc")
            {
                HoSoChinhThuc = true;
            }



            if ((ThaoTac)Session["ThaoTac"] == ThaoTac.ThemMoi)
            {
                bool kq = don.ThemChu(HoSoChinhThuc, Session["DangKyBienDong"].ToString(), drDanhXung.Text, txtHoTen.Text, txtNamSinh.Text, txtDiaChi.Text, txtDinhDanh.Text, txtSoDinhDanh.Text, txtNoiCap.Text, txtNgayCap.Text, txtQuocTich.Text);
            }
            else if ((ThaoTac)Session["ThaoTac"] == ThaoTac.DangSua)
            {
                bool kq = don.SuaChu(HoSoChinhThuc, lblMaChu.Text.Replace("Mã chủ: ", " ").Trim(), drDanhXung.Text, txtHoTen.Text, txtNamSinh.Text, txtDiaChi.Text, txtDinhDanh.Text, txtSoDinhDanh.Text, txtNoiCap.Text, txtNgayCap.Text, txtQuocTich.Text);
            }

            LoadgrvChu();

            Session["ThaoTac"] = ThaoTac.KhongNhap;
            ApDungTrangThai();
        }
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                long _maChu = long.Parse(e.CommandArgument.ToString());

                if (Convert.ToInt32(Session["DangKyBienDong"]) > 0)
                {
                    XuLyDangKyBienDong don = new XuLyDangKyBienDong();
                    don.ThemChu(false, Session["DangKyBienDong"].ToString(), e.CommandArgument.ToString());

                    Response.Redirect(string.Format("~/NguoiDan/DangKyBienDong/DonDangKyBienDong.aspx?MaDangKyBienDong={0}", Session["DangKyBienDong"].ToString()));
                }
            }
        }