예제 #1
0
        public int AddUpdate(Feedback item)
        {
            int newID = 0;
            using (StoredProcedure sp = new StoredProcedure("Feedback_Add"))
            {
                sp.Params.Add("FirstName", System.Data.SqlDbType.NVarChar).Value = item.FirstName;
                sp.Params.Add("LastName", System.Data.SqlDbType.NVarChar).Value = item.LastName;
                sp.Params.Add("Telephone", System.Data.SqlDbType.NVarChar).Value = item.Telephone;
                sp.Params.Add("EMail", System.Data.SqlDbType.NVarChar).Value = item.EMail;
                sp.Params.Add("Company", System.Data.SqlDbType.NVarChar).Value = item.Company;
                sp.Params.Add("Position", System.Data.SqlDbType.NVarChar).Value = item.Position;
                sp.Params.Add("Comment", System.Data.SqlDbType.NVarChar).Value = item.Comment;
                sp.Params.Add("UserInfo", System.Data.SqlDbType.NVarChar).Value = item.UserInfo;

                newID = Convert.ToInt32(sp.ExecuteScalar());
                item.ID = newID;
            }
            return newID;
        }
예제 #2
0
        private void SaveRequest()
        {
            string lastName = txtLastName.Text;
            string firstName = txtFirstName.Text;
            string position = txtPosition.Text;
            string company = txtCompany.Text;
            string comment = txtComment.Text;
            string email = txtEmail.Text;
            string phone = txtTelephone.Text;

            Feedbacks feedbacks = new Feedbacks();
            Feedback item = new Feedback();

            item.LastName = lastName;
            item.FirstName = firstName;
            item.Position = position;
            item.Company = company;
            item.Comment = comment;
            item.EMail = email;
            item.Telephone = phone;

            item.UserInfo = item.UserInfo = Server.UrlDecode(Request.ServerVariables.ToString().Replace("%0d%0a", "\r\n")).Replace("&","\r\n\t");

            feedbacks.AddUpdate(item);
        }