コード例 #1
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            string strTicID   = Request.QueryString["TicId"].ToString();
            string strCurUser = Convert.ToString(Session["CurrentUser"]);

            BusinessObjects bo            = new BusinessObjects();
            bool            retval        = bo.AddTicResponses(strTicID, lblTitle.Text, strCurUser, txtResponse.Text);
            string          strRole       = Convert.ToString(Session["Role"]);
            string          strToMailAddr = "";

            if (strRole.ToUpper() == "INSTRUCTOR")
            {
                strToMailAddr = bo.GetEmailByTicID(strTicID);
                SendMail(strTicID, "Instructor", strCurUser, strToMailAddr);
            }
            else if (strRole.ToUpper() == "STUDENT")
            {
                strToMailAddr = bo.GetEmailByUser(Convert.ToString(ViewState["InstID"]));
                SendMail(strTicID, "Student", strCurUser, strToMailAddr);
            }



            if (retval == true)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Responded Successfully')", true);
            }
            txtResponse.Text = "";
        }
コード例 #2
0
        protected void btnPost_Click(object sender, EventArgs e)
        {
            BusinessObjects bo            = new BusinessObjects();
            var             rnd           = new Random(DateTime.Now.Millisecond);
            int             ticid         = rnd.Next(0, 3000);
            string          strTic_ID     = "TIC" + ticid.ToString();
            string          strCurUser    = Convert.ToString(Session["CurrentUser"]);
            bool            retVal        = bo.PostTicket(strTic_ID, txtTitle.Text, strCurUser, "Open", txtDesc.Text, ddlInst.SelectedItem.Text);
            string          strToMailAddr = bo.GetEmailByUser(ddlInst.SelectedItem.Text);

            //SendMail(strTic_ID, strCurUser, strToMailAddr);//Uncomment123
            if (retVal == true)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Ticket Created Successfully')", true);
            }
        }
コード例 #3
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            string strRole = Convert.ToString(Session["Role"]);

            if (strRole.ToUpper() != "STUDENT")
            {
                if (ddlTicViewStatus.SelectedItem.Text == "Select")
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Please select ,who all can view this ticket')", true);
                    return;
                }
                if (ddlSubType.SelectedItem.Text == "Select")
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Subject Type is Required')", true);
                    return;
                }
            }

            string strTicID   = Request.QueryString["TicId"].ToString();
            string strCurUser = Convert.ToString(Session["CurrentUser"]);

            BusinessObjects bo     = new BusinessObjects();
            bool            retval = bo.AddTicResponses(strTicID, lblTitle.Text, strCurUser, txtResponse.Text);

            string strToMailAddr = "";

            if (strRole.ToUpper() == "INSTRUCTOR")
            {
                strToMailAddr = bo.GetEmailByTicID(strTicID);
                //SendMail(strTicID, "Instructor", strCurUser, strToMailAddr);//Uncomment123
            }
            else if (strRole.ToUpper() == "STUDENT")
            {
                strToMailAddr = bo.GetEmailByUser(Convert.ToString(ViewState["InstID"]));
                //SendMail(strTicID, "Student", strCurUser, strToMailAddr);//Uncomment123
            }



            if (retval == true)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Responded Successfully')", true);
            }
            txtResponse.Text = "";
        }
コード例 #4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text == "" && txtEmail.Text == "")
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('User ID or Email ID is Required')", true);
                return;
            }
            BusinessObjects bo     = new BusinessObjects();
            string          strPwd = bo.ForgotPwd(txtUsername.Text, txtEmail.Text);
            //EncryptionDecryption crypt = new EncryptionDecryption();
            string strDecryptedPwd = EncryptDecrypt.Decrypt(strPwd);

            if (strDecryptedPwd == "" || strDecryptedPwd == null)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Invalid User ID or Email ID')", true);
                return;
            }

            string strEmail = "";

            if (txtUsername.Text != "")
            {
                strEmail = bo.GetEmailByUser(txtUsername.Text);
                if (strEmail == "" || strEmail == null)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Invalid User ID')", true);
                    return;
                }
            }
            if (txtEmail.Text != "")
            {
                int retVal = bo.ChkEmailID(txtEmail.Text);
                if (retVal == 1)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "AlertBox('Invalid Email ID')", true);
                    return;
                }
                strEmail = txtEmail.Text;
            }
            //SendMail(strEmail, strDecryptedPwd);Uncomment123
            Page.ClientScript.RegisterStartupScript(this.GetType(), "AlertScript", "ReAlertBox()", true);
        }