Пример #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 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 = "";
        }