Exemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                UserFeedback objRequest = new UserFeedback();

                objRequest.REQUESTID = "F" + DateTime.Now.Ticks;
                objRequest.NAME = txtName.Text.Trim();
                objRequest.EMAIL = txtEmail.Text.Trim();
                objRequest.MOBILE = txtMobile.Text.Trim();
                objRequest.MESSAGE = txtFeedback.Text.Trim();

                bool result = objUser.InsertUserFeedback(objRequest);

                if (result)
                {
                    lblMsg.Text = "Thank you for sharing your feedback / suggestion with us.";
                    ClearControls();
                }
                else
                {
                    lblMsg.Text = "Oops! Something went wrong. Please try again later.";
                }
            }
            catch (Exception ex)
            {
                objUser.InsertWebsiteLog(Common.TOKEN, "ucLogin.aspx.cs", "btnSubmit_Click", "", ex.ToString());
            }
        }
Exemplo n.º 2
0
        public bool InsertUserFeedback(UserFeedback objUserFeedback)
        {
            DataSet ds = new DataSet();
            bool result = false;
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[5];
                sqlParams[0] = new SqlParameter("@REQUESTID", SqlDbType.VarChar);
                sqlParams[0].Value = objUserFeedback.REQUESTID;
                sqlParams[1] = new SqlParameter("@NAME", SqlDbType.VarChar);
                sqlParams[1].Value = objUserFeedback.NAME;
                sqlParams[2] = new SqlParameter("@EMAIL", SqlDbType.VarChar);
                sqlParams[2].Value = objUserFeedback.EMAIL;
                sqlParams[3] = new SqlParameter("@MOBILE", SqlDbType.VarChar);
                sqlParams[3].Value = objUserFeedback.MOBILE;
                sqlParams[4] = new SqlParameter("@FEEDBACKMESSAGE", SqlDbType.VarChar);
                sqlParams[4].Value = objUserFeedback.MESSAGE;

                int a = CExecuteNonQuery("USP_INSERTUSERFEEDBACK", sqlParams);

                if (a > 0)
                {
                    result = true;
                }
            }
            catch (Exception ex)
            {
                InsertWebsiteLog(Common.TOKEN, "User.cs", "InsertUserFeedback", JsonConvert.SerializeObject(objUserFeedback), ex.ToString());
            }
            return result;
        }