예제 #1
0
        private void button_ProfSave_Click(object sender, EventArgs e)
        {
            foreach (var item in Controls)
            {
                errorReg.SetError((Control)item, "");
            }
            sstReg.Text = "";
            validate();
            if (!validate())
            {
                return;
            }
            else
            {
                ThongTinCaNhan ttcn = thongtincanhan.Single(tt => tt.TenDangNhap == TDN);
                ttcn.HoTen    = txtHoTen.Text;
                ttcn.NgaySinh = dateNgaySinh.Value;
                ttcn.DiaChi   = txtDiachi.Text;
                ttcn.CMND     = Convert.ToInt32(txtCMND.Text);
                ttcn.SDT      = Convert.ToInt32(txtDT.Text);
                ttcn.Email    = txtEmail.Text;

                MemoryStream ms = new MemoryStream();
                pictureBox_Prof.Image.Save(ms, ImageFormat.Gif);

                ttcn.ImageByte = new Binary(ms.ToArray());
                filmDC.SubmitChanges();

                MessageBox.Show("Lưu thành công!", "Thông Báo");
            }
        }
예제 #2
0
        public string UpdateThongTinCaNhan(ThongTinCaNhan tt)
        {
            NguoiDung nguoi = data.NguoiDungs.SingleOrDefault(m => m.MaNguoiDung == tt.Ma);

            nguoi.AnhDaiDien  = tt.AnhDaiDien;
            nguoi.Email       = tt.Email;
            nguoi.SoDienThoai = tt.SoDienThoai;
            data.SaveChanges();

            return(nguoi.Taikhoan);
        }
예제 #3
0
        public ThongTinCaNhan GetTTCN(string tk)
        {
            var            nguoi = data.NguoiDungs.SingleOrDefault(m => m.Taikhoan == tk);
            ThongTinCaNhan tt    = new ThongTinCaNhan();

            tt.AnhDaiDien  = nguoi.AnhDaiDien;
            tt.Email       = nguoi.Email;
            tt.SoDienThoai = nguoi.SoDienThoai;
            tt.Ma          = nguoi.MaNguoiDung;
            return(tt);
        }
예제 #4
0
        public ActionResult ThongTinCaNhan(ThongTinCaNhan tt, HttpPostedFileBase fileupload)
        {
            if (fileupload != null)
            {
                var Anh = ThemAnh(fileupload);
                tt.AnhDaiDien = Anh;
            }
            DAO.DAONguoiDung tt1 = new DAO.DAONguoiDung();
            if (tt1.CheckEmail(tt.Email))
            {
                ModelState.AddModelError("", "Đã có Email này");
            }
            tt1.UpdateThongTinCaNhan(tt);
            var nguoi = data.NguoiDungs.SingleOrDefault(m => m.MaNguoiDung == tt.Ma);

            return(RedirectToAction("Index", "User"));
        }
예제 #5
0
        public ThongTinCaNhan GetThongTinCaNhan(ThanhVien thanhVien)
        {
            OracleConnection conn = new OracleConnection();

            conn = Connect(thanhVien);
            try
            {
                conn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection  = conn;
                cmd.CommandText = $"select * from qlbc.thanhvien where matv = " + GetMaTV(thanhVien).ToString();
                var er = cmd.ExecuteReader();
                List <DSUngVien> dSUngViens = new List <DSUngVien>();
                er.Read();
                ThongTinCaNhan thongTinCaNhan = new ThongTinCaNhan()
                {
                    ma              = er.GetInt32(0),
                    HoVaTen         = er.GetString(1),
                    Phai            = er.GetString(2),
                    QueQuan         = er.GetString(3),
                    Ngaysinh        = er.GetDateTime(4).ToString("dd/MM/yyyy"),
                    QuocTich        = er.GetString(5),
                    DiaChiThuongTru = er.GetString(6),
                    DiaChiTamTru    = er.GetString(7),
                    VaiTro          = er.GetString(8),
                    MaDonVi         = er.GetInt32(9),
                    ViTriCongTac    = er.GetString(10),
                    NghiPhep        = er.GetString(11),
                    LyDoNghiPhep    = er.GetString(12),
                    UserName        = er.GetString(13),
                    MaLinhVuc       = er.GetInt32(14)
                };
                conn.Close();
                return(thongTinCaNhan);
            }
            catch (OracleException)
            {
                conn.Close();
                return(null);
            }
            finally
            {
                conn.Close();
            }
        }
예제 #6
0
        public static ThongTinCaNhan GetThongTinCaNhan(string maSinhVien)
        {
            UMS_HUSCEntities db = new UMS_HUSCEntities();
            var thongTinCaNhan  = db.VThongTinCaNhans.FirstOrDefault(v => v.MaSinhVien.Equals(maSinhVien));
            var hocKyTacNghiep  = db.VHocKies.FirstOrDefault(i => i.MaHocKy == thongTinCaNhan.HocKyTacNghiep);
            var thongTin        = new ThongTinCaNhan()
            {
                MaSinhVien     = thongTinCaNhan.MaSinhVien,
                HoTen          = thongTinCaNhan.HoTen,
                MaTaiKhoan     = thongTinCaNhan.MaTaiKhoan,
                KhoaHoc        = thongTinCaNhan.KhoaHoc,
                TenNganh       = thongTinCaNhan.TenNganh,
                AnhDaiDien     = thongTinCaNhan.AnhDaiDien,
                HocKyTacNghiep = hocKyTacNghiep
            };

            return(thongTin);
        }
예제 #7
0
        private void FormThongTinCaNhan_Load(object sender, EventArgs e)
        {
            ThongTinCaNhan thongTinCaNhan = bll.GetThongTinCaNhan(ThanhVien);

            lbHoVaTen.Text         = thongTinCaNhan.HoVaTen;
            lbGioitinh.Text        = thongTinCaNhan.Phai;
            lbQueQuan.Text         = thongTinCaNhan.QueQuan;
            lbNgaySinh.Text        = thongTinCaNhan.Ngaysinh;
            lbQuocTich.Text        = thongTinCaNhan.QuocTich;
            lbDiaChiThuongTru.Text = thongTinCaNhan.DiaChiThuongTru;
            lbDiaChiTamTru.Text    = thongTinCaNhan.DiaChiTamTru;
            lbVaiTRo.Text          = thongTinCaNhan.VaiTro;
            lbMaDonVi.Text         = thongTinCaNhan.MaDonVi.ToString();
            lbViTriCongTac.Text    = thongTinCaNhan.ViTriCongTac;
            lbNghiPhep.Text        = thongTinCaNhan.NghiPhep;
            lbLyDoNghiPhep.Text    = thongTinCaNhan.LyDoNghiPhep;
            lbUserName.Text        = thongTinCaNhan.UserName;
            lbMaLinhVuc.Text       = thongTinCaNhan.MaLinhVuc.ToString();
        }
예제 #8
0
        public bool kiemTraDangNhap()
        {
            List <ThongTinCaNhan> ttcn = phanQuyen.getThongTinCaNhan();
            string         tendn       = txtUsername.Text;
            string         mk          = txtPassword.Text;
            ThongTinCaNhan tt          = null;

            foreach (ThongTinCaNhan thongtin in ttcn)
            {
                if (thongtin.SDT.Equals(tendn))
                {
                    tt = new ThongTinCaNhan();
                    tt = thongtin;
                    break;
                }
            }
            if (tt == null)
            {
                MessageBox.Show("Tên đăng nhập không tồn tại.");
                return(false);
            }
            else
            {
                if (tt.MatKhau.Equals(mk))
                {
                    maLoaiTK  = tt.MaLoaiTK;
                    maThiSinh = tt.MaTS;
                    maKyThi   = tt.MaKyThi;
                    return(true);
                }
                else
                {
                    MessageBox.Show("Mật khẩu không đúng.");
                    return(false);
                }
            }
        }
예제 #9
0
        private void btnXemThongTin_Click(object sender, EventArgs e)
        {
            ThongTinCaNhan ThongTinCaNhan = new ThongTinCaNhan();

            ThongTinCaNhan.ShowDialog();
        }
예제 #10
0
 public ThongTinCaNhanEditViewModel(ThongTinCaNhan entity) : base(entity)
 {
 }