Ejemplo n.º 1
0
        public List <MemberSimply> GetAllMembersSimply()
        {
            List <MemberSimply> elements = new List <MemberSimply>();
            string    sql = "select ID,姓名 from TF_Member order by ID desc";
            DataTable dt  = sqlHelper.Query(sql);

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MemberSimply element = new MemberSimply();
                    element.ID = Convert.ToInt32(dt.Rows[i]["ID"]);
                    element.姓名 = dt.Rows[i]["姓名"].ToString();
                    elements.Add(element);
                }
            }
            return(elements);
        }
Ejemplo n.º 2
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex > -1)
     {
         MemberSimply memberSimply = comboBox1.SelectedItem as MemberSimply;
         Member       member       = MemberLogic.GetInstance().GetMember(memberSimply.ID);
         if (member != null)
         {
             textBox1.Text                 = member.姓名;
             comboBox2.SelectedIndex       = (int)member.性别;
             comboBox3.SelectedIndex       = GetIndexByCardType(member.卡种, comboBox3);
             textBox2.Text                 = member.卡号;
             textBox11.Text                = member.开卡日.ToString("yyyy-MM-dd");
             monthCalendar3.SelectionStart = member.开卡日;
             textBox3.Text                 = member.到期日.ToString("yyyy-MM-dd");
             monthCalendar1.SelectionStart = member.到期日;
             textBox4.Text                 = member.生日.ToString("yyyy-MM-dd");
             monthCalendar2.SelectionStart = member.生日;
             textBox5.Text                 = member.电话;
             textBox10.Text                = member.住址;
             textBox6.Text                 = member.备注;
         }
     }
 }