private void LoadTypeList() { //获取会员卡分类对象,查询会员卡分类信息 MemberCTypeInfoBll mtiBll = new MemberCTypeInfoBll(); List <MemberCTypeInfo> list = mtiBll.GetList(0); //将会员卡信息绑定到控件上 txtType.DisplayMember = "MCType"; //显示的属性(看见的) txtType.ValueMember = "MCId"; //用于存储值的属性 txtType.DataSource = list; }
private void txtType_SelectedIndexChanged(object sender, EventArgs e) { MemberCTypeInfoBll mtiBll = new MemberCTypeInfoBll(); int idtemp = Convert.ToInt32(txtType.SelectedValue); var listdays = mtiBll.GetList(idtemp); int days = Convert.ToInt32(listdays[0].MCDay); if (listdays.Count == 1) { dtp2.Value = DateTime.Now.AddDays(days); } temp = dtp2.Value; }
private void LoadList() { MemberCTypeInfoBll mtiBll = new MemberCTypeInfoBll(); List <MemberCTypeInfo> list1 = mtiBll.GetList(0); list1.Insert(0, new MemberCTypeInfo() { MCId = 0, MCType = "请选择类型", }); txtxkType.DisplayMember = "MCType"; txtxkType.ValueMember = "MCId"; txtxkType.DataSource = list1; }
private void LoadList() { dataGridView1.AutoGenerateColumns = false; dataGridView1.DataSource = mtiBll.GetList(0); }