Coding > Index page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data;
using System.Web.UI.WebControls;
public partial class Index : System.Web.UI.Page
{
BusinessLogic obj_business = new BusinessLogic();
DataContext obj_datacontext = new DataContext();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = obj_business.getitemtypes();
datalisttypes.DataSource = dt;
datalisttypes.DataBind();
}
}
protected void btnsubmit_Click(object sender, EventArgs e)
{
string query = "select* from tbl_usermaster where username = '"+txtUsername.Text.ToString()+"'";
DataTable dt = obj_datacontext.getdataTable(query);
int refid = Convert.ToInt32(dt.Rows[0]["i_autoid"].ToString());
string query1 = "select * from tbl_userdetails where ref_id = '"+refid+"'";
DataTable dt1 = obj_datacontext.getdataTable(query1);
if (dt.Rows.Count > 0)
{
Session["username"] = dt.Rows[0]["username"].ToString();
Session["userid"] = Convert.ToInt32(dt.Rows[0]["i_autoid"].ToString());
if(dt.Rows[0]["username"].ToString() == Session["username"].ToString() && dt.Rows[0]["password"].ToString()==txtpwd.Text.ToString())
{
if (dt1.Rows[0]["user_type"].ToString() == "vendor")
{
Response.Redirect("myaccountvendor.aspx?userid=" + Session["userid"].ToString());
}
else if (dt1.Rows[0]["user_type"].ToString() == "both")
{
Response.Redirect("myaccountboth.aspx?userid=" + Session["userid"].ToString());
}
else if (dt1.Rows[0]["user_type"].ToString() == "customer")
{
Response.Redirect("myaccountcustomer.aspx?userid=" + Session["userid"].ToString());
}
}
}
}
protected void btnsignup_Click(object sender, EventArgs e)
{
Response.Redirect("registration.aspx");
}
public string getSRC(object imgSRC)
{
DataRowView dRView = (DataRowView)imgSRC;
string ImageName = dRView["typeimage"].ToString();
if (ImageName == "NoImage")
{
return ResolveUrl(@"~/UserImage/missing.jpg");
}
else
{
return ResolveUrl(ImageName);
}
}
public string itemtype(object sURL)
{
DataRowView dRView = (DataRowView)sURL;
string heading = dRView["typename"].ToString();
return heading;
}
protected void btnforgot_Click(object sender, EventArgs e)
{
Response.Redirect("PasswordRecovery.aspx");
}
}
This site is designed to help BCA MCA student to develop final project and synopsis Download Free BCA Project, MCA Project, IT Projects, Final report and Project synopsis with Full documentation and code
free download MCA projects in ASP.NET with complete source code, Free download MCA projects in VB,NET with complete source code, Free download MCA MSc projects in C#.net with complete source code,
Free download MCA projects in JAVA with complete source code, Free download MCA projects in PHP with complete source code, Free download BSc CS IT projects in PHP,JAVA, ASP.NET with source code
Computer Science Final Project , Free download MCA projects in asp.net , Free download MCA projects in vb.net, Free download MCA projects in C#.net, Free download MCA projects in java, Free download MCA projects in PHP