Example #1
0
    protected void btnAllSend_Click(object sender, EventArgs e)
    {
        //Create varndStatusiables
        string ALLStdNo;
        string ALLSender;
        string ALLMsg;

        if (AllContactsList.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < AllContactsList.Tables[0].Rows.Count; i++)
            {

               ALLStdNo  = AllContactsList.Tables[0].Rows[i][0].ToString();

                btnSendAllRst.Text = "Cancel";
                //Preceeding notifiation image shows
                ImgAll.Visible = true;
                //Show status
                lblAllStatu.Visible = true;
                //Get student no from dropdown list
                //ALLStdNo = txtStdPrntNo.Text;
                //Get sender details from text field
                ALLSender = txt_Ind_Sender.Text;
                //Get meeesage from text field
                ALLMsg = txt_Ind_Msg.Text.Trim();
                //save mobile # in to session
                Session["mobileNo"] = ALLStdNo;
                //string number = "94716233138";//Request.QueryString[""];
                //string message = "Gayan.. cheeers...!!! working properly";//Request.QueryString["message"];

                //Create object from RoutoSMSTelecom
                RoutoSMSTelecom routo = new RoutoSMSTelecom();
                //Set user name
                routo.SetUser("1175036");
                //Set password
                routo.SetPass("td389jvf");
                //Set receiver's mobile no
                routo.SetNumber(ALLStdNo);
                //Set sender's details
                routo.SetOwnNumber(ALLSender);
                //Set message type
                routo.SetType("SMS");
                //Set the message
                routo.SetMessage(ALLMsg);

                //Send message
                string header = routo.Send();
                //Check the header
                if (header == "error")
                {
                    //change label attributes
                    lblAllStatu.ForeColor = System.Drawing.Color.Red;
                    lblAllStatu.Text = "Connectiing.... Internet Failure !";
                    btnAllSend.Text = "Retry";
                }
                else
                {
                    //HIde notification inage
                    ImgInd.Visible = false;
                    //Show message sent notification
                    lblAllStatu.Text = "Message sent to +" + Session["mobileNo"];
                    //clear data fields after sending the messages
                    txtSchlCount.Text = "";
                    txt_All_Sender.Text = "";
                    txt_all_Msg.Text = "";

                }

            }
        }
        //lblAllStatu.Text = "All Messages are sent";
    }
Example #2
0
    protected void btnSendGrp_Click(object sender, EventArgs e)
    {
        //for (int a = 0; a < 5; a++)
        //{

            BtnRstGrp.Text = "Cancel";
            //Preceeding notifiation image shows
            ImgProcessGrp.Visible = true;
            //Show status
            lblStstusGrp.Visible = true;
            //Create variables
            string GrpStdNo = "94716233138";
            string GrpSender;
            string GrpMsg;
            //Get student no from dropdown list
            //GrpStdNo = DrpdwnStdList.SelectedItem.ToString();
            //Get sender details from text field
            GrpSender = txtSenderGrp.Text;
            //Get meeesage from text field
            GrpMsg = txtMsgGroup.Text.Trim();
            //save mobile # in to session
            Session["mobileNo"] = GrpStdNo;
            //string number = "94716233138";//Request.QueryString[""];
            //string message = "Gayan.. cheeers...!!! working properly";//Request.QueryString["message"];

            //Create object from RoutoSMSTelecom
            RoutoSMSTelecom routo = new RoutoSMSTelecom();
            //Set user name
            routo.SetUser("1175036");
            //Set password
            routo.SetPass("td389jvf");
            //Set receiver's mobile no
            routo.SetNumber(GrpStdNo);
            //Set sender's details
            routo.SetOwnNumber(GrpSender);
            //Set message type
            routo.SetType("SMS");
            //Set the message
            routo.SetMessage(GrpMsg);

            //Send message
            string header = routo.Send();
            //Check the header
            if (header == "error")
            {
                //change label attributes
                lblStstusGrp.ForeColor = System.Drawing.Color.Red;
                lblStstusGrp.Text = "Connectiing.... Internet Failure !";
                btnSendGrp.Text = "Retry";
            }
            else
            {
                //HIde notification inage
                ImgProcessGrp.Visible = false;
                //Show message sent notification
                lblStstusGrp.Text = "Message sent to +" + Session["mobileNo"];
                //clear data fields after sending the messages
                DrpdwnStdList.ClearSelection();
                txtSenderGrp.Text = "";
                txtMsgGroup.Text = "";

            }
        //}
    }
Example #3
0
    protected void btnClassSend_Click(object sender, EventArgs e)
    {
        btnClassRst.Text = "Cancel";

        //Preceeding notifiation image shows
        ImgClass.Visible = true;
        //Show status
        lblClassStatus.Visible = true;
        //Create variables
        string ClassStdNo;
        string ClassSender;
        string ClassMsg;
        //Get student no from dropdown list
        ClassStdNo = txtStdCount_grade.Text;
        //Get sender details from text field
        ClassSender = txt_Grade_sender.Text;
        //Get meeesage from text field
        ClassMsg = txt_Grade_Msg.Text.Trim();
        //save mobile # in to session
        Session["mobileNo"] = ClassStdNo;
        //string number = "94716233138";//Request.QueryString[""];
        //string message = "Gayan.. cheeers...!!! working properly";//Request.QueryString["message"];

        //Create object from RoutoSMSTelecom
        RoutoSMSTelecom routo = new RoutoSMSTelecom();
        //Set user name
        routo.SetUser("1175036");
        //Set password
        routo.SetPass("td389jvf");
        //Set receiver's mobile no
        routo.SetNumber(ClassStdNo);
        //Set sender's details
        routo.SetOwnNumber(ClassSender);
        //Set message type
        routo.SetType("SMS");
        //Set the message
        routo.SetMessage(ClassMsg);

        //Send message
        string header = routo.Send();
        //Check the header
        if (header == "error")
        {
            //change label attributes
            lblClassStatus.ForeColor = System.Drawing.Color.Red;
            lblClassStatus.Text = "Connectiing.... Internet Failure !";
            btnClassSend.Text = "Retry";
        }
        else
        {
            //HIde notification inage
            ImgClass.Visible = false;
            //Show message sent notification
            lblClassStatus.Text = "Message sent to +" + Session["mobileNo"];
            //clear data fields after sending the messages
            txtCnt_Class.Text = "";
            txt_Class_sender.Text = "";
            txt_Class_Msg.Text = "";

        }
    }