Professional Documents
Culture Documents
Using Using Using Using Using Using Using Using Using Using Using Public Partial Class
Using Using Using Using Using Using Using Using Using Using Using Public Partial Class
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
lstemp.Items.Add(Convert.ToString(dr.GetInt32(0)));
}
cn.Close();
}
}
protected void edit_Click1(object sender, EventArgs e)
{
Response.Redirect("editemp.aspx");
}
protected void remove_Click(object sender, EventArgs e)
{
Label1.Visible = true;
}
protected void pend_Click(object sender, EventArgs e)
{
Response.Redirect("pending.aspx");
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (txtaddate.Text == "")
{
}
if( txtddate.Text == "")
{
}
else if(txttreatment.Text == "")
{
Label11.Text = "Details are not proper......Your claim
will be pending";
}
else if( txttype.Text == "" )
{
else
{
cn.Open();
SqlCommand cmd = new SqlCommand("insert into claim values(" +
txtclaim.Text + "," + txtempid.Text + "," + txtamt.Text + ",'" + txttype.Text
+ "','" + DropDownList1.SelectedItem.Text + "','" +
DateTime.Parse(txtaddate.Text) + "','" + DateTime.Parse(txtddate.Text) + "','"
+ txtsurgery.Text + "','" + txttreatment.Text + "','" +
DateTime.Parse(txtapply.Text) + "')", cn);
cmd.ExecuteNonQuery();
cn.Close();
cn.Open();
SqlCommand cmd2 = new SqlCommand("insert into
status(claimid,empid) values(" + txtclaim.Text + "," + txtempid.Text + ")",
cn);
cmd2.ExecuteNonQuery();
cn.Close();
}
txtdetails.Text=dr.GetString(1);
cn.Close();
}
else
{
txtdetails.Text = "Employee not exists";
}
cn.Close();
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "")
{
Label3.Text = "User Id must not be empty";
}
if(TextBox2.Text=="")
{
Label3.Text = "Password must not be empty";
}
if (TextBox1.Text == "admin" && TextBox2.Text == "admin")
{
Response.Redirect("admin.aspx");
}
cn.Open();
SqlCommand cmd = new SqlCommand("select * from login where
empid="+TextBox1.Text+" and password='"+TextBox2.Text+"'",cn );
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Response.Redirect("claim.aspx");
}
else
{
Label3.Text = "YOU CAN'T LOGIN WITH IMPROPER PASSWORD AND EMPID";
}
}
}