using System; using System.Collections; using System.Configuration; using System.Data; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml; using System.Data.SqlClient; using System.Data.SqlTypes; public partial class Administrator_EnquiryUpdate : System.Web.UI.Page { SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString); DataSet ds = new DataSet(); SqlCommand cmd; FillDD objFillDD = new FillDD(); Dashboard objDash = new Dashboard(); protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } } public void Reset() { txtName.Text = ""; txtRemarks.Text = ""; } protected void btnReset_Click(object sender, EventArgs e) { lblErr.Text = ""; Reset(); } protected void btnSubmit_Click(object sender, EventArgs e) { if (Request.QueryString["id"] != "") { try { String Dgid; con.Open(); cmd = new SqlCommand(); cmd.CommandText = "SpEnquiryUpdate"; cmd.CommandType = CommandType.StoredProcedure; cmd.Connection = con; cmd.Parameters.AddWithValue("@Id", Request.QueryString["id"]); cmd.Parameters.AddWithValue("@Status", DDStatus.SelectedItem.Text); cmd.Parameters.AddWithValue("@ModifyBy", txtName.Text); cmd.Parameters.AddWithValue("@Remarks", txtRemarks.Text); cmd.Parameters.AddWithValue("@ModifyDate", System.DateTime.Now.ToString("MM/dd/yyyy")); int j = cmd.ExecuteNonQuery(); if (j != 0) { lblErr.Visible = true; lblErr.Text = "Enquiry Update Submitted Successfully"; } else { lblErr.Text = "Enquiry Update not Submitted Successfully,Please Try Again "; } } catch (Exception ex) { lblErr.Visible = true; lblErr.Text = "Please Contact to Admin :" + ex.Message.ToString(); } finally { con.Close(); } } } }