public bool Execute(InquiryStructure structure) { Program.da.createCommand("elmarfin.dbo.sp_insert_inquiry"); Program.da.addParameter("@message", structure.message); Program.da.addParameter("@name", structure.name); Program.da.addParameter("@contactnumber", structure.contactnumber); Program.da.addParameter("@email", structure.email); Program.da.useStoreProcedure(); if (Program.da.executeCommand()) { return(true); } return(false); }
protected void Button1_Click(object sender, EventArgs e) { InquiryStructure inquiry = new InquiryStructure(); inquiry.name = txt_name.Text; inquiry.email = txt_email.Text; inquiry.contactnumber = getINT(txt_contactnumber.Text); inquiry.message = txt_message.Text; Inquiryrules insert = new Inquiryrules(); if (insert.Execute(inquiry)) { txt_name.Text = ""; txt_email.Text = ""; txt_contactnumber.Text = ""; txt_message.Text = ""; } else { } }