コード例 #1
0
ファイル: NhanVienModel.cs プロジェクト: hainguyentn94/VNPT
        public List <DANH_MUC_GIOI_TINH> getAllGioiTinh()
        {
            db = new ConnectDb();
            List <DANH_MUC_GIOI_TINH> list = new List <DANH_MUC_GIOI_TINH>();
            SqlCommand cmd = new SqlCommand("getAllGioiTinh", db.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            sdr             = cmd.ExecuteReader();
            while (sdr.Read())
            {
                DANH_MUC_GIOI_TINH gt = new DANH_MUC_GIOI_TINH();
                gt.GIOITINH = (int)sdr["GIOITINH"];
                gt.CHITIET  = (string)sdr["CHITIET"];

                list.Add(gt);
            }
            return(list);
        }
コード例 #2
0
ファイル: NhanVienModel.cs プロジェクト: hainguyentn94/VNPT
        public List <DANH_SACH_NHAN_VIEN_1> getAllNhanVien()
        {
            db = new ConnectDb();
            List <DANH_SACH_NHAN_VIEN_1> list = new List <DANH_SACH_NHAN_VIEN_1>();
            SqlCommand cmd = new SqlCommand("SELECT_DANH_SACH_NHAN_VIEN", db.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            sdr             = cmd.ExecuteReader();
            while (sdr.Read())
            {
                DANH_MUC_NGUOI_DUNG item_danh_muc_nguoi_dung = new DANH_MUC_NGUOI_DUNG();
                DANH_MUC_DIA_CHI    item_danh_muc_dia_chi    = new DANH_MUC_DIA_CHI();
                DANH_MUC_GIOI_TINH  item_danh_muc_gioi_tinh  = new DANH_MUC_GIOI_TINH();
                item_danh_muc_nguoi_dung.TAIKHOAN      = (string)sdr["TAIKHOAN"];
                item_danh_muc_nguoi_dung.MATKHAU       = (string)sdr["MATKHAU"];
                item_danh_muc_nguoi_dung.HOTEN         = (string)sdr["HOTEN"];
                item_danh_muc_gioi_tinh.CHITIET        = (string)sdr["CHITIET"];
                item_danh_muc_nguoi_dung.NGAYSINH      = (DateTime)sdr["NGAYSINH"];
                item_danh_muc_nguoi_dung.SODIENTHOAI   = (string)sdr["SODIENTHOAI"];
                item_danh_muc_nguoi_dung.EMAIL         = (string)sdr["EMAIL"];
                item_danh_muc_dia_chi.TENDIACHI        = (string)sdr["TENDIACHI"];
                item_danh_muc_nguoi_dung.CHITIETDIACHI = (string)sdr["CHITIETDIACHI"];
                item_danh_muc_nguoi_dung.TRANGTHAI     = (int)sdr["TRANGTHAI"];

                list.Add(new DANH_SACH_NHAN_VIEN_1(item_danh_muc_nguoi_dung.TAIKHOAN,
                                                   item_danh_muc_nguoi_dung.HOTEN,
                                                   item_danh_muc_nguoi_dung.MATKHAU,
                                                   item_danh_muc_gioi_tinh.CHITIET,
                                                   item_danh_muc_nguoi_dung.NGAYSINH,
                                                   item_danh_muc_nguoi_dung.SODIENTHOAI,
                                                   item_danh_muc_nguoi_dung.EMAIL,
                                                   item_danh_muc_dia_chi.TENDIACHI,
                                                   item_danh_muc_nguoi_dung.CHITIETDIACHI,
                                                   item_danh_muc_nguoi_dung.TRANGTHAI));
            }
            return(list);
        }