Ejemplo n.º 1
0
        public List <DANH_MUC_DIA_CHI> getDiaChiTinh()
        {
            db = new ConnectDb();
            List <DANH_MUC_DIA_CHI> list = new List <DANH_MUC_DIA_CHI>();
            SqlCommand cmd = new SqlCommand("SELECT_DIA_CHI_TINH", db.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            sdr             = cmd.ExecuteReader();
            while (sdr.Read())
            {
                DANH_MUC_DIA_CHI dc = new DANH_MUC_DIA_CHI();
                dc.MADIACHI    = (int)sdr["MADIACHI"];
                dc.MADIACHICHA = (int)sdr["MADIACHICHA"];
                dc.TENDIACHI   = (string)sdr["TENDIACHI"];

                list.Add(dc);
            }
            return(list);
        }
Ejemplo n.º 2
0
        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);
        }