示例#1
0
 public frmQLGiay()
 {
     InitializeComponent();
     Dgv_Giay.AutoGenerateColumns = false;
     Dgv_Giay.DataSource          = CallApiGiay.GetAllGiay();
     cbx_hieuGiay.DataSource      = CallHieuGiay.GetAllHieuGiay();
     cbx_hieuGiay.DisplayMember   = "TENHIEUGIAY";
     setEnable(false);
 }
示例#2
0
        public frmDatHang()
        {
            InitializeComponent();
            DGV_DatHang.AutoGenerateColumns = false;
            DGV_KH.AutoGenerateColumns      = false;
            DGV_KH.DataSource = CallKH.GetAllKhachHang();

            //cbxGioiTinh.DataSource = list;
            //cbxGioiTinh.DisplayMember = "value";

            cbxNSX.DataSource    = CallHieuGiay.GetAllHieuGiay();
            cbxNSX.DisplayMember = "TENHIEUGIAY";

            cbxMauSac.DataSource    = callMauGiay.GetAllMauGiay();
            cbxMauSac.DisplayMember = "TENMAUGIAY";

            cbxCoGiay.DataSource    = CallCoGiay.GetAllCoGiay();
            cbxCoGiay.DisplayMember = "TENCOGIAY";

            cbxMaGiay.DataSource    = callGiay.GetAllGiay();
            cbxMaGiay.DisplayMember = "MAGIAY";

            GioiTinhs = new List <GioiTinh>();
            GioiTinhs.Add(new GioiTinh {
                Ma = true, Ten = "Nam"
            });
            GioiTinhs.Add(new GioiTinh {
                Ma = false, Ten = "Nữ"
            });
            SelectedGioiTinh = GioiTinhs[0];

            cbxGioiTinh.DataSource    = GioiTinhs;
            cbxGioiTinh.DisplayMember = "Ten";
            cbxGioiTinh.ValueMember   = "Ma";
            cbxGioiTinh.SelectedItem  = SelectedGioiTinh;

            cbxGioiTinh.SelectedValueChanged += (sender, s) =>
            {
                SelectedGioiTinh = cbxGioiTinh.SelectedItem as GioiTinh;
            };
        }