private void panel4_VisibleChanged(object sender, EventArgs e) { listView4.Items.Clear(); listView3.Items.Clear(); List <AdminsMDL> list = AdminsBLL.getlist(null); foreach (AdminsMDL item in list) { ListViewItem lv = new ListViewItem(item.userid.ToString()); lv.SubItems.Add(item.UserName); lv.SubItems.Add(item.UserCompellation); listView4.Items.Add(lv); } List <VipGradeMDL> list1 = VipGradeBLL.getlist(null); foreach (VipGradeMDL item in list1) { ListViewItem lv = new ListViewItem(item.vgid.ToString()); lv.SubItems.Add(item.vgname); lv.SubItems.Add(item.vgdiscount.ToString()); listView3.Items.Add(lv); } FileStream fs = new FileStream("配置文件.ini", FileMode.Open); StreamReader rd = new StreamReader(fs, Encoding.Default); while (!rd.EndOfStream) { string r = rd.ReadLine(); string r1 = r.Split(':')[0]; switch (r1) { case "系统名称": textBox2.Text = r.Split(':')[1]; break; case "发票打印抬头": textBox3.Text = r.Split(':')[1]; break; default: break; } } rd.Close(); fs.Close(); }
private void vipAdd_Load(object sender, EventArgs e) { List <VipGradeMDL> list = VipGradeBLL.getlist(null); list.Insert(1, new VipGradeMDL() { vgname = "其他会员", vgid = 0 }); comboBox1.DataSource = list; comboBox1.DisplayMember = "vgname"; comboBox1.ValueMember = "vgid"; if (showState == 1) { label7.Text = (VipsBLL.GetMaxID() + 1).ToString(); label8.Text = "添加会员"; } else { label8.Text = "修改会员"; label7.Text = id.ToString(); List <VipsMDL> list_v = VipsBLL.GetVips(id); if (list_v.Count <= 0) { return; } textBox1.Text = list_v[0].VipName; textBox2.Text = list_v[0].VipTel; comboBox1.SelectedValue = list_v[0].GradeID; if (list_v[0].VipSex == "男") { radioButton1.Checked = true; } else { radioButton2.Checked = true; } dateTimePicker1.Value = Convert.ToDateTime(list_v[0].VipEndDate); } }