Exemple #1
0
 protected void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         IList <ContacterInfo> allMobileContacters = new List <ContacterInfo>();
         if (this.RadIncept1.Checked)
         {
             allMobileContacters = Contacter.GetAllMobileContacters();
         }
         if (this.RadIncept2.Checked)
         {
             allMobileContacters = Contacter.GetMobileContacterByGroupId(this.GetUserGroupId(this.ChklUserGroupList));
         }
         if (this.RadIncept3.Checked)
         {
             allMobileContacters = Contacter.GetMobileContacterByUserName(this.TxtUserName.Text);
         }
         if (this.RadIncept4.Checked)
         {
             allMobileContacters = Contacter.GetMobileContacterByUserId(DataConverter.CLng(this.TxtStartUser.Text), DataConverter.CLng(this.TxtEndUser.Text));
         }
         StringBuilder sb = new StringBuilder();
         foreach (ContacterInfo info in allMobileContacters)
         {
             string mobile = info.Mobile;
             if (string.IsNullOrEmpty(mobile) || (mobile.Length != 11))
             {
                 mobile = info.Phs;
             }
             if (!string.IsNullOrEmpty(mobile))
             {
                 string append = mobile + "," + info.TrueName + "," + info.UserName;
                 StringHelper.AppendString(sb, append, "\r\n");
             }
         }
         this.TxtSendNum.Text       = sb.ToString();
         this.TxtContent.Text       = this.TxtMessage.Text;
         this.LabRecieverCount.Text = allMobileContacters.Count.ToString();
         this.LabMessageCount.Text  = (allMobileContacters.Count * ((this.TxtContent.Text.Length / 70) + 1)).ToString();
         if (this.RadSendType.Checked)
         {
             this.SendTiming.Value = "0";
         }
         else
         {
             this.SendTiming.Value = "1";
         }
         this.SendTime.Value = this.Dpk.Text;
         this.Panel2.Visible = true;
         this.Panel1.Visible = false;
     }
 }