This HTML code is for navbar buttons
<div id="nav">
<div class="content">
<ul>
<li><a href="Default.aspx">Home </a> </li>
<li><a href="Apply.aspx">Apply </a></li>
<li><a href="follow.aspx">Follow Up </a></li>
<li><a href="login.aspx">Admin Login </a></li>
</ul>
</div>
</div>
public static string ConnectionString = WebConfigurationManager.ConnectionStrings["patientVoiceDBConnectionString"].ConnectionString;
// هذا الكونكشن
public SqlConnection Dtconection = new SqlConnection(ConnectionString);
SqlCommand com = new SqlCommand();
When the user click on the “apply” button, connection is created, data is saved and email is sent.
This code is to open connection
public void begintrans()
{
com.Connection = Dtconection;
Dtconection.Open();
}
This function is for “Apply” button
protected void LinkButton1_Click(object sender, EventArgs e)
{
DataSet1TableAdapters.PatientRequestTableAdapter ta = new DataSet1TableAdapters.PatientRequestTableAdapter();
long id;
int CurrentYear=DateTime.Today.Year;
try
{
id=(long)ta.GetID();
}
catch (Exception exc1)
{
id=1;
}
try
{
ta.Insert(id, CurrentYear, t1.SelectedValue, t2.Text , t3.Text, t4.Text,long.Parse( t5.Text),long.Parse( t6.Text), t7.Text, int.Parse( t8.SelectedValue), t9.Text, t10.SelectedValue, t11.Text, "Pending");
Class1 e1 = new Class1();
e1.SendEmail(CurrentYear.ToString() + "-" + id.ToString(),t7.Text);
MultiView1.ActiveViewIndex = 1;
}
catch (Exception exc2)
{
msg.Visible = true;
msg.Text = exc2.Message;
}
}
No comments:
Post a Comment