/// <summary>
 /// 验证邀请码的正确性,正确则返回该邀请码的作用
 /// </summary>
 /// <param name="invitationCode"></param>
 /// <returns></returns>
 public InvitationCodeMsgCommon CheckInvitationCode(string invitationCode)
 {
     SqlDataReader sdr = filmMsg.CheckInvitationCode(invitationCode);
     InvitationCodeMsgCommon icm = new InvitationCodeMsgCommon();
     if (sdr.HasRows)
     {
         while (sdr.Read())
         {
             icm.InvitationCode = sdr.GetString(0);
             icm.FilmId = sdr.GetInt32(1);
             icm.Deadline = sdr.GetDateTime(2).ToString();
             icm.CodeState = sdr.GetInt32(3);
         }
     }
     else
     {
         return null;
     }
     return icm;
 }
 /// <summary>
 /// 邀请码兑换电影票处理
 /// </summary>
 /// <param name="invitationCode"></param>
 public Boolean HandleCodeMsg(string invitationCode)
 {
     imc = fmb.CheckInvitationCode(invitationCode);
     if (imc == null)
     {
         MessageBox.Show("你的邀请码有错,请重新输入");
         txt_giver.Text = "";
         txt_giver.Select();
         return false;
     }
     else if (imc.CodeState == 0)
     {
         DialogResult ds = MessageBox.Show("不好意思,您的邀请码已过期,是否输入新的邀请码?", "过期提醒", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         //可以做一个功能,选择是返回继续输入邀请码,否的话,底下取票按钮变成购买按钮,用户可以就自己选择的座位购买票
         if (ds == DialogResult.Yes)
         {
             txt_giver.Text = "";//清空邀请码框内容
             txt_giver.Select();//焦点返回输入邀请码控件
         }
         else
         {
             txt_giver.Enabled = false;
             txt_giver.Text = "";
             btn_confirm.Select();
         }
         return false;
     }
     else//进行确定操作
     {
         //根据邀请码跳转到相应的电影处
         this.trv1_movieList.SelectedNode = trv1_movieList.Nodes[imc.FilmId - 1];
         this.trv1_movieList.SelectedNode.BackColor = Color.BlueViolet;
         return true;
     }
 }