using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using nmsSetup; using System.Data; using System.Data.SqlClient; using nmsDropDown; public partial class Default2 : System.Web.UI.Page { clsBLSetup b; IndustryPartner obj; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { bind_State(); bind_BusinessSector(); } } public void bind_State() { List lst = new List(); clsPRPdropdown prp = new clsPRPdropdown(); clsDLdropDown obj = new clsDLdropDown(); b = new clsBLSetup(); prp.id = 0; prp.spName = "selState"; lst = obj.SelectDropDown(prp); ddlstate.DataSource = lst; ddlstate.DataTextField = "name"; ddlstate.DataValueField = "id"; ddlstate.DataBind(); } public void bind_BusinessSector() { List lst = new List(); clsPRPdropdown prp = new clsPRPdropdown(); clsDLdropDown obj = new clsDLdropDown(); b = new clsBLSetup(); prp.id = 0; prp.spName = "Bind_BusinessSector"; lst = obj.SelectDropDown(prp); ddlbusinesssecctor.DataSource = lst; ddlbusinesssecctor.DataTextField = "name"; ddlbusinesssecctor.DataValueField = "id"; ddlbusinesssecctor.DataBind(); } public void insPartner() { obj = new IndustryPartner(); b = new clsBLSetup(); obj.ipName = txtname.Text; obj.ipJobTitle = txtjobtitle.Text; obj.ipCompanyName = txtcompanyname.Text; obj.ipCompanyWebsite = txtcompanywebstie.Text; obj.ipbsId =Convert.ToInt32(ddlbusinesssecctor.SelectedValue); obj.ipceid =Convert.ToInt32(ddlcompnyemp.SelectedValue); obj.iperid =Convert.ToInt32(ddlrequriedemp.SelectedValue); obj.ipMobile = txtphone.Text; obj.ipEmail = txtemail.Text; obj.ipState= Convert.ToInt32(ddlstate.SelectedValue); obj.ipComment = txtcomment.Text; string m = b.insertInPartner(obj); if (m == "Submit Successfully") { Reset(); } ScriptManager.RegisterStartupScript(Page, Page.GetType(), "showError", "alert('" + m + "');", true); } public void Reset() { txtname.Text=""; txtjobtitle.Text=""; txtcompanyname.Text=""; txtcompanywebstie.Text=""; ddlbusinesssecctor.SelectedIndex=0; ddlcompnyemp.SelectedIndex = 0; ddlrequriedemp.SelectedIndex = 0; txtphone.Text=""; txtemail.Text=""; obj.ipState = ddlstate.SelectedIndex = 0; txtcomment.Text=""; } protected void Button1_Click(object sender, EventArgs e) { insPartner(); } }