示例#1
0
    protected void BtnRegister_Click(object sender, EventArgs e)
    {
        bool partnerExists = true;

        if (TxtBxPartnerID.Text != "")
        {
            partnerExists = Participant.CheckParticipantTTID(int.Parse(TxtBxPartnerID.Text.Substring(2)));
        }
        if (partnerExists)
        {
            Participant participant = InitializeParticipant();
            int         ttid        = Participant.AddNewParticipant(participant);
            if (ttid != 0)
            {
                //bool mailSent = Communication.Sendmail("*****@*****.**", "", participant.EmailID, "Techtrishna 2014 registration", "You are successfully registered in Techtrishan 2014. Your registration id is TT" + ttid.ToString());
                LblResult.Text = "Registered. Your ID is TT" + ttid.ToString();
            }
            else
            {
                LblResult.Text = "Error! Please try again.";
            }
        }
        else
        {
            LblResult.Text = "Invalid Partner ID";
        }
    }
示例#2
0
    protected void BtnRegister_Click(object sender, EventArgs e)
    {
        bool partnerExists = true;

        if (TxtBxPartnerID.Text != "")
        {
            partnerExists = Participant.CheckParticipantTTID(int.Parse(TxtBxPartnerID.Text.Substring(2)));
        }
        if (partnerExists)
        {
            Participant participant = InitializeParticipant();
            int         ttid        = Participant.InsertParticipantDetails(participant);
            if (ttid != 0)
            {
                string body = GetEmailBody(ttid);
                Communication.Sendmail("*****@*****.**", "Tech Trishna 2015", participant.EmailID, "Registration Successful", body);
                LblResult.Text = "Registered. Your ID is TT" + ttid.ToString();
            }
            else
            {
                LblResult.Text = "Already Registered.";
            }
        }
        else
        {
            LblResult.Text = "Invalid Partner ID";
        }
    }
示例#3
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        bool partnerExists = true;

        if (txtbxProfilePartnerId.Text != "")
        {
            if (txtbxProfilePartnerId.Text == LblTTID.Text)
            {
                lblProfileResult.Text = "Partner ID should be different from your TTID";
                return;
            }
            else
            {
                partnerExists = Participant.CheckParticipantTTID(int.Parse(txtbxProfilePartnerId.Text.Substring(2)));
            }
        }
        if (partnerExists)
        {
            Participant participant = InitializeParticipantProfile();
            participant.TTID = int.Parse(LblTTID.Text.Substring(2));
            bool detailsUpdated = Participant.UpdateParticipantDetails(participant);
            if (detailsUpdated)
            {
                lblProfileResult.Text = "Details Updated";
                Session["EmailID"]    = participant.EmailID;
            }
            else
            {
                LblResult.Text = "Error! Please try again.";
            }
        }
        else
        {
            LblResult.Text = "Invalid Partner ID";
        }
    }