Upload
shruti-shankar
View
227
Download
0
Embed Size (px)
Citation preview
E-AUCTION SYSTEM
2
Table of Contents
Acknowledgement...................................................3
Project Objective .................................................... 4
Project Scope ...........................................................5
Requirement Specification...................................... 6
Database Design ...................................................... 8
Application Work Flow ........................................... 9
Screenshots .......................................................... 10
Future Scope of Improvements ............................ 11
Code...................................................................... 12
Certificate ............................................................. 13
3
Acknowledgement
I take this opportunity to express my profound gratitude and deep regards to my faculty Mr. Ashok Gupta for his exemplary guidance, monitoring and constant encouragement throughout the course of this project. The blessing, help and guidance given by him/her time to time shall carry me a long way in the journey of life on which I am about to embark.
I am obliged to my project team members for the valuable information provided by them in their respective fields. I am grateful for their cooperation during the period of my assignment.
Md.Prince
4
Project Objective :
The primary project goals consist of:1. Now a days, a lot of people are interested in online shopping. So online-auction management system is a platform to sell or buy products by browsing the internet.
2. This web-management system will help to connect the buyer and the seller on line. A seller can sell his/her product through this web portal without any harassment.
3. On the other hand many companies are willing to spend a lot of money for advertising their product, promoting and for other purposes. Thus by advertising the profit will be attractive and all those advertisement can be gathered in a website and all the users can see it easily.
4. The most important is this website is more environment-friendly compared to traditional advertising method of making the schedule of the auction because it does not require a lot of papers or using the paints to paint on those building that are harmful to our environment.
5. Now the people will get to know about the all the products which are to be auctioned without any loop-holes.
6. The main feature of this web-system is transparency as it is online and nothing is hidden from the user.
5
Project Scope :
The broad scope of the E-Auction project includes: 1. The purpose of this project is to build an on-line auction management system, a place for buyers and sellers to come together and trade almost anything.
2. The system will be available on an online platform for 24x7 access to the users.
3. The system consists in a web-portal where registered users can propose new auctions, place bids in order to buy the items on auction and the items are to be auctioned that is controlled by administrator.
4. The system will help to meet the users with the product they want to buy
5. There is full transparency in this portal. No loop-holes are there.
6
Requirement Specification :
Domain Description: Why ASP.NET?Visual studio brings us closer to ASP.NET. There is no MVC project type or web forms project any longer, there is just ASP.NET. If you want to mix web forms and web API, or MVC and signalR, go ahead! You are encouraged and supported .New features and functionality are brought in with budget without breaking existing apps. New tools like browser link make building for the web more enjoyable than ever.ASP.NET is open sources ,developed in the open ,and accepting community contributions .one ASP.NET and VS 2013 added some amazing new tooling enhancements for HTML5,CSS3 and java script.Whats available on ASP.NET today and where is ASP.NET headed tomorrow and what do you need to know to best support the code you have written and the code you will write.
Problem Definition: Virtual auctions on the internet. The seller sells the product or service to the person who bids the highest price. For sellers , online auction open up new sells channels for new product and offer buyers favorable purchasings conditions .online auction have effectively created a giant virtual marketplace where people can gather to buy ,sell, trade and check out the goods of the day. They are enormously popular, high-traffic venues where you can begin selling product almost immediately, with No overhead or upfront cost. No sales staff or distributors . No website of your own . No initial investment.
1. 7
Functional Requirements :
Maintenance module:a) Member maintenance: This module allow access of authorized admin only to maintain member details. Admin can view all the details and delete member.
b) Product maintenance: This module allows access of authorized admin to maintain details of all products. Through this module admin can add, update and delete details of products and categorized them.
8
Registration module:a) Member registration: This module let the non members who are interested to the website register as a member and the personal information provided will be encrypted if user requested. Users need to fill up their personal information including phone number.
Security Module:
a) Login/Logout: Different level of users can process different type features on the website. Member can bid item, buy item or sell item on the website. Advertiser just can upload advertisement and maintain their advertisement. Admin can maintain all members and advertiser details, maintain website layout, blocking member and so on. b)Forget password: This module is giving user a chance to get back their password once they forget their original password. When users forgotten their login password, they can send a request to the system. After that the system will generate the email and resend the password 9
to the user personal email address and they have used to register before so the users can be login again to the system.Auction Modulea) Release item: This module allows only the admin to post the items that the admin wish to have auction on. Admin needs to provide the item details, price, auction period and the picture of the item.b) Bid item: This module allows the users to bid the item that they are interested on it. Every time the customer enters the bid price, the system will update the particular items current bid price immediately, so that other customer can refer to the updated bid price. After session ended, all customers are not allowed to bid the item anymore. Once the bidding success, system will automatically send the email to the buyer and also seller. User can cancel the bidding of the item that is still inactive to bid.c) Market place: All the basic information of auction item is showed here. For ex:- item id , auction id description, image of the item, market price, auction type (like buyout price or bid price 10
of the product), the time(start date, end date), comment for the product, the item of the auction item bid, and the auction item status
Feedback module:a) Complaint This module responding to user complaints. To the end of the auction transaction, the buyer and seller can rate the credit level to each other. But, if the transaction do not complete or have been cheated, user can make a complaint through the website. The website will make the adjustment if the complaint on the same user has exceeded a certain number, the back office administrator will be giving punishment depending on the circumstances of the transaction.
11
Hardware /Software RequirementsHardware requirement 1. Client side 56 kbps Dial up modem or better (For Internet Connection) PC with Pentium 4 and 512 RAM (or better).2. Server Side 56 kbps Dial up modem or better (For Internet Connection) PC with Intel Core i3 and 4gb RAM (or better) .NET Framework 4.0
Software Requirement1. Client Side Web Browser(Internet Explorer, Firefox, Safari, opera) Windows XP (or better)2. Server Side Web Browser(Internet Explorer, Firefox, Safari, opera) Windows XP (or better) Microsoft SQL Server 2010.Net Framework 4.0
Table Structure: Table Name: tblUsernameColumn NameData TypeConstraints
UsernameVarchar(50)Not Null
PasswordVarchar(50)Not Null
AddressVarchar(100)Not Null
Email_idVarchar(50)Not Null
PhoneNoVarchar(50)Not Null
SecurityQuesVarchar(50)Not Null
AnsVarchar(50)Not Null
No_of_biddingsint
Table Name: tblItems
Column NameData TypeConstraints
CategoryIdIntNot Null
ItemIDIntNot Null
ItemNameVarchar(50)Not Null
DescriptionVarchar(100)Not Null
OriginalPriceFloatNot Null
StartBidDateDatetimeNot Null
StartBidPriceFloatNot Null
EndDateDatetimeNot Null
PhotoVarchar(50)Not Null
Highest_bidIntNot Null
No_of_bidsintNull
Table Name: tblBddinginfoColumn NameData TypeConstraints
BiddingPriceFloatNot Null
UserNameVarchar(50)Not Null
ItemIdIntNot Null
DateDatetimeNot Null
BidInt Null
Table Name: tblBddingWinnerColumn NameData TypeConstraints
BiddingPriceFloatNot Null
UserNameVarchar(50)Not Null
ItemIdIntNot Null
DateDatetimeNot Null
BidInt Null
Table Name: tblCategory Column NameData TypeConstraints
CategoryidIntNot Null
CategorynameVarchar(50)Not Null
ParentedIntNot Null
Category_PicVarchar(50)Null
12
Database Design:
13
Application Work Flow:
Bid.aspxContactUs.aspxItemView.aspxCategoryView.aspxHome.aspxDeclareWinner.aspxForgetpassword.aspxHome.aspxViewItem.aspxViewCategory.aspxAdd.aspxAdminPanel.aspxHome.aspxRegistration.aspxLogin.aspxDailyBids.com
14
Screenshots:
Future Scope of Improvements: This web-system can improve a lot. This website should improve to keep track the transaction between buyer and seller.
Other than that the web-system should can let seller give discount to their product when their product almost end duration but still nobody wants to buy.
This website can be improved by keep track the try log-in time. If exceed three time then it will block that ip address.
This can be improved by adding a live chat box to interact with the customer care if the buyer faces any problem.
Code:Class Data Access Layer(clsdal)using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data.SqlClient;using System.Data;/// /// Summary description for clsDAL/// public static class clsDAL{ static String connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString.ToString();
private static SqlConnection MyConnection() { SqlConnection con = new SqlConnection(connectionstring); return con; } public static int InsertUpdateDelete(String query) { int result = 0; SqlConnection con = MyConnection();
con.Open(); SqlCommand com = new SqlCommand(query, con); result = com.ExecuteNonQuery(); con.Close(); return result; } public static DataSet getData(String query) { DataSet ds = new DataSet(); SqlConnection con = MyConnection();
SqlDataAdapter da = new SqlDataAdapter(query, con); da.Fill(ds);
return ds; } public static int CheckData(String query) { int result = 0; SqlConnection con = MyConnection();
con.Open(); SqlCommand com = new SqlCommand(query, con); SqlDataReader dr = com.ExecuteReader(); if (dr.Read()) { result = 1; } dr.Close(); con.Close(); return result;
}}
Class item(clsitem.cs)using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data;using System.Collections;
/// /// Summary description for clsBook/// public class clsItem{ public int ParentID { get; set; } public int CategoryID { get; set; } public int ItemID { get; set; } public String Item_Name { get; set; } public String Description { get; set; } public float OriginalPrice { get; set; } public String StartBidDate { get; set; } public float StartBidPrice { get; set; } public float HighestBid { get; set; } public String EndDate { get; set; }
Public string Photo { get; set; } public String CategoryName { get; set; } public string CategoryPic { get; set; } public int AddCategory() { String query = "insert into tblCategory(ParentId,CategoryName,Category_Pic) values('" + ParentID + "','" + CategoryName +"','"+CategoryPic+"')"; return clsDAL.InsertUpdateDelete(query); }
public int AddItem() { string itemID = this.ItemID.ToString(); string categoryID = this.CategoryID.ToString(); this.ItemID = int.Parse(categoryID + itemID); String query = "insert into tblItems(categoryID,itemId,itemName,Description,originalPrice,startBidDate,startBidPrice,EndDate,Photo,Highest_Bid,no_of_bids) values('" + CategoryID + "','" + ItemID + "','" + Item_Name+ "','" + Description + "','" + OriginalPrice + "','" + StartBidDate + "','" + StartBidPrice + "','" + EndDate + "','" + Photo +"','" + StartBidPrice+ "',0)"; return clsDAL.InsertUpdateDelete(query);
} public int deleteCategory() { String query = "delete from tblCategory where categoryID='" + CategoryID + "'"; return clsDAL.InsertUpdateDelete(query);
} public int UpdateCategory() { String query = "update tblCategory set parentID='" + ParentID + "',CategoryName='" + CategoryName + "' where categoryID='" + CategoryID + "'"; return clsDAL.InsertUpdateDelete(query);
} public DataSet getAllData() { //String query = "select * from tblmember"; //return clsDAL.getData("select * from tblmember"); String query = "select * from tblCategory"; DataSet ds = clsDAL.getData(query); return ds; }
public DataSet getAllItems() { String query = "select * from tblItems"; DataSet ds = clsDAL.getData(query); return ds; } public DataSet getItem(int ItemID) { String query = "select * from tblItems where itemID='"+ItemID+"'"; DataSet ds = clsDAL.getData(query); return ds; } public int updateitems() {
string query = "update tblItems set itemName='" + Item_Name + "',Description='" + Description + "',originalPrice='" + OriginalPrice + "',startBidDate='" + StartBidDate + "',startBidPrice='" + StartBidPrice + "',EndDate='" + EndDate + "',Photo='" + Photo + "' where itemID='" + ItemID + "'"; int res = clsDAL.InsertUpdateDelete(query); return res; } public int deleteitem() { string query = "delete from tblItems where itemID=" + ItemID; int res = clsDAL.InsertUpdateDelete(query); return res; } public DataSet getCategoryItems() { DateTime end_date; DateTime today = DateTime.Now; TimeSpan ts; String query = "Select * from tblItems where categoryID='" + CategoryID + "'"; DataSet ds = clsDAL.getData(query); if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { if (DateTime.Parse(dr["EndDate"].ToString()) < today) { dr.Delete(); break; } end_date = DateTime.Parse(dr["EndDate"].ToString()); ts = end_date.Subtract(today); if (ts.Days == 0) { dr.Delete(); } } } else { ds = null; } return ds; } public DataSet HotBidding() { DataSet ds = null; String Query = "Select * from tblItems order by no_of_bids desc"; ds=clsDAL.getData(Query); int flag = 0; foreach (DataRow dr in ds.Tables[0].Rows) { if (flag > 2) dr.Delete(); flag = flag + 1; } return ds; } public void BiddingWinner() { DateTime end_date;
DateTime today = DateTime.Now; TimeSpan ts; String query = "select * from tblItems"; DataSet ds = clsDAL.getData(query); String Query1 = null; DataSet ds1 = null; DataTable dt; foreach(DataRow dr in ds.Tables[0].Rows) { Query1 = "Select * from tblBiddingInfo where ItemID='" + dr["ItemID"].ToString() + "'and Bidding_Price='" + dr["Highest_Bid"].ToString() + "'"; ds1 = clsDAL.getData(Query1); if (ds1.Tables[0].Rows.Count == 1) { end_date = DateTime.Parse(dr["EndDate"].ToString()); ts = end_date.Subtract(today); if (ts.Days == 0) { foreach(DataRow dr1 in ds1.Tables[0].Rows) { query = "insert into tblBiddingWinner(username,ItemID,Price,Date) values ('" + dr1["Username"].ToString() + "','" + dr1["ItemID"].ToString() + "','" + dr1["Bidding_Price"].ToString() + "','" + DateTime.Now.ToString() + "')"; int check = clsDAL.InsertUpdateDelete(query); } } } } }}
Class user(clsuser.cs)using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Data;
/// /// Summary description for clsUser/// public class clsUser{ public String Name { get; set; } public String Address { get; set;
} public String EmailID { get; set; } public String PhoneNo { get; set; } public String Password { get; set; } public String SecQue { get; set; } public String SecAns { get; set; } public int AddUser() { String query = "insert into tblUsername(Username,Password,Address,Email_ID,PhoneNo,SecurityQues,Ans,no_of_biddings) values('" + Name + "','" + Password + "','" + Address + "','" + EmailID + "','" + PhoneNo + "','" + SecQue + "','" + SecAns+"',0)"; return clsDAL.InsertUpdateDelete(query); } public DataSet CheckUser() { String Query = "Select Username from tblUsername where email_id='" + EmailID + "' and password='"+Password+"'"; return clsDAL.getData(Query);
} public DataSet getsq() { String query = "select * from tblUsername where email_id='" + EmailID + "'"; return clsDAL.getData(query); } public DataSet getUser() { String query = "select * from tblUsername"; return clsDAL.getData(query); } public DataSet TopBidders() { DataSet ds = null;
String Query = "Select * from tblUsername order by no_of_biddings desc"; ds = clsDAL.getData(Query); int flag = 0; foreach (DataRow dr in ds.Tables[0].Rows) {
if (flag > 1) dr.Delete(); flag = flag + 1; } return ds; }}
adminMasterPage.aspx.csusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Collections;public partial class adminMasterPage : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack == false) { BindDropDownList(DropDownList1); BindDropDownList(ddlCategoryName); lbladdMessage.Text = ""; lblchangeMessage.Text = ""; } } public void BindDropDownList(DropDownList ddl) { clsItem obj = new clsItem(); DataSet ds = obj.getAllData(); ddl.DataSource = ds.Tables[0]; ddl.DataTextField = "categoryName"; ddl.DataValueField = "categoryID"; ddl.DataBind(); } protected void btnSave_Click(object sender, EventArgs e) { clsItem newCategory = new clsItem(); newCategory.ParentID = int.Parse(DropDownList1.SelectedItem.Value ); newCategory.CategoryName = txtCategoryName.Text; String pic_filename = ""; if (fileCategoryPhoto.HasFile) { pic_filename = System.IO.Path.GetFileName(fileCategoryPhoto.PostedFile.FileName); String[] arrfile = pic_filename.Split('.'); pic_filename = arrfile[0] + DateTime.Now.ToString("hhmmyyyyMMdd") + "." + arrfile[1]; string serverpath = Server.MapPath("cat_images\\" + pic_filename); fileCategoryPhoto.PostedFile.SaveAs(serverpath); } newCategory.CategoryPic = pic_filename; int check=newCategory.AddCategory(); if (check == 1) { lbladdMessage.Text = "New Category Added"; txtCategoryName.Text = ""; BindDropDownList(DropDownList1); BindDropDownList(ddlCategoryName); } }
protected void btnUpdate_Click(object sender, EventArgs e) {
}
protected void btnItemSave_Click(object sender, EventArgs e) { clsItem newItem = new clsItem(); newItem.CategoryID = int.Parse(ddlCategoryName.SelectedItem.Value); newItem.ItemID = int.Parse(ddlCategoryName.SelectedItem.Value+txtItemID.Text); newItem.Item_Name = txtItemName.Text; newItem.OriginalPrice = float.Parse(txtOriginalPrice.Text); newItem.StartBidPrice = float.Parse(txtStartBidPrice.Text); newItem.StartBidDate = ddlsMonth.SelectedItem.Value + "-" + ddlsDay.Text + "-" + ddlsYear.Text; newItem.EndDate = ddleMonth.SelectedItem.Value + "-" + ddleDay.Text + "-" + ddleYear.Text; String Description = txtDescription.Text; String[] arrDescription = Description.Split(' '); Description = null; for (int i = 0; i 0) { foreach (DataRow dr in Ds.Tables[0].Rows) { objUser.Name = dr["Username"].ToString(); Session["myuser"] = objUser; if (Request.QueryString["itemID"] == null) Response.Redirect("Default.aspx"); else { Response.Redirect("ViewItemDetails.aspx?ID=" + Request.QueryString["itemID"].ToString()); } } } else lblmessage.Text = "Invalid Username and Password"; txtPassword.Text = ""; txtUsername.Text = ""; txtUsername.Focus(); } }}
PasswordRecovery.aspx.csusing 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 PasswordRecovery : System.Web.UI.Page{ protected void ddlSecurityques_SelectedIndexChanged(object sender, EventArgs e) {
} protected void btngetpass_Click(object sender, EventArgs e) {
String pass=""; clsUser obj=new clsUser();
obj.EmailID=txtusername.Text; DataSet ds= obj.getsq(); if
(ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in
ds.Tables[0].Rows) { if (txtans.Text == dr["Ans"].ToString()
&& txtsq.Text == dr["SecurityQues"].ToString()) pass =
"Your Password is
" + dr["Password"].ToString(); else { pass = "Invalid Security
Question and Answer"; } } } else { pass = "Invalid Email id"; }
lblpassword.Text = pass; } protected void Page_Load(object sender,
EventArgs e) { }}Registration.aspx.csusing System;using
System.Collections.Generic;using System.Linq;using System.Web;using
System.Web.UI;using System.Web.UI.WebControls;using
System.Data;public partial class Registration : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e) { if
(Session["myuser"] != null) { Label lblName =
(Label)this.Master.FindControl("lblName"); clsUser obj =
(clsUser)Session["myuser"]; lblName.Text = "Welcome " + obj.Name; }
} protected void Button1_Click(object sender, EventArgs e) {
clsUser newUserobj = new clsUser(); newUserobj.Name = txtName.Text;
newUserobj.Address = txtAddress.Text; newUserobj.EmailID =
txtEmailId.Text; newUserobj.Password = txtPassword.Text;
newUserobj.PhoneNo = txtPhoneNo.Text; newUserobj.SecAns =
txtSAns.Text; newUserobj.SecQue = txtSQ.Text; DataSet ds =
newUserobj.CheckUser(); if (ds.Tables[0].Rows.Count == 0) { int
check = newUserobj.AddUser(); txtAddress.Text = "";
txtCPassword.Text = ""; txtEmailId.Text = ""; txtName.Text = "";
txtPassword.Text = ""; txtPhoneNo.Text = ""; txtSQ.Text = "";
txtSAns.Text = ""; if (check == 1) { lblMessage.Text = "Welcome to
Daily Bidders...
Your Username is
" + newUserobj.EmailID; } if (Session["myuser"] != null) { Label
lblName = (Label)this.Master.FindControl("lblName"); clsUser obj =
(clsUser)Session["myuser"]; lblName.Text = "Welcome " + obj.Name; }
} else { lblMessage.Text = "This email ID is already Registered..";
txtAddress.Text = ""; txtCPassword.Text = ""; txtEmailId.Text = "";
txtName.Text = ""; txtPassword.Text = ""; txtPhoneNo.Text = "";
txtSQ.Text = ""; txtSAns.Text = ""; } }}UitemView.aspx.csusing
System;using System.Collections.Generic;using System.Linq;using
System.Web;using System.Web.UI;using
System.Web.UI.WebControls;using System.Data;public partial class
UItemView : System.Web.UI.Page{ protected void Page_Load(object
sender, EventArgs e) { Label lblName =
(Label)this.Master.FindControl("lbluser"); HyperLink hp =
(HyperLink)this.Master.FindControl("logout"); if (Session["myuser"]
!= null) { clsUser obj = (clsUser)Session["myuser"]; lblName.Text =
"Welcome " + obj.Name; hp.Visible = true; } BindDatalist(); }
public void BindDatalist() { clsItem objItem = new clsItem();
objItem.CategoryID = int.Parse(Request.QueryString["ID"]); DataSet
ds = objItem.getCategoryItems(); DataList1.DataSource =
ds.Tables[0]; DataList1.DataBind(); if (ds == null) {
lblMessage.Text = "No Items Found... Try Again"; } }
}UserView.aspx.csusing System;using
System.Collections.Generic;using System.Linq;using System.Web;using
System.Web.UI;using System.Web.UI.WebControls;using
System.Data;public partial class Userview : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e) { Label
lblName = (Label)this.Master.FindControl("lbluser"); HyperLink hp =
(HyperLink)this.Master.FindControl("logout"); if (Session["myuser"]
!= null) { clsUser obj = (clsUser)Session["myuser"]; lblName.Text =
"Welcome " + obj.Name; hp.Visible = true; } BindDatalist(); }
public void BindDatalist() { clsItem objItem = new clsItem();
DataSet ds = objItem.getAllData(); DataList1.DataSource =
ds.Tables[0]; DataList1.DataBind(); } protected void
DataList1_SelectedIndexChanged(object sender, EventArgs e) {
}}ViewCategories.aspx.csusing System;using
System.Collections.Generic;using System.Linq;using System.Web;using
System.Web.UI;using System.Web.UI.WebControls;using
System.Data;public partial class ViewCategories :
System.Web.UI.Page{ protected void Page_Load(object sender,
EventArgs e) { if (Session["myuser"] != null) { Label lblName =
(Label)this.Master.FindControl("lblName"); clsUser obj =
(clsUser)Session["myuser"]; lblName.Text = "Welcome " + obj.Name; }
bool posted = this.IsPostBack; if (this.IsPostBack == false) {
bindGridViewCategories(); } } private void bindGridViewCategories()
{ clsItem newobj = new clsItem(); DataSet ds = newobj.getAllData();
gridviewCategories.DataSource = ds.Tables[0];
gridviewCategories.DataBind(); } protected void
btnDelete_Click(object sender, EventArgs e) { } protected void
gridviewCategories_RowEditing(object sender, GridViewEditEventArgs
e) { int editrowindex = e.NewEditIndex;
gridviewCategories.EditIndex = editrowindex;
bindGridViewCategories(); } protected void
gridviewCategories_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e) { gridviewCategories.SetEditRow(-1)
; bindGridViewCategories(); } protected void
gridviewCategories_RowUpdating(object sender,
GridViewUpdateEventArgs e) { int editrowindex = e.RowIndex; Label
lblCategoryID =
(Label)gridviewCategories.Rows[editrowindex].Cells[0].FindControl("lblCategoryID");
TextBox txtCategoryName =
(TextBox)gridviewCategories.Rows[editrowindex].Cells[1].FindControl("txtCategoryName");
TextBox txtParentID =
(TextBox)gridviewCategories.Rows[editrowindex].Cells[2].FindControl("txtParentID");
clsItem newCategory = new clsItem(); newCategory.CategoryID =
int.Parse(lblCategoryID.Text); newCategory.ParentID =
int.Parse(txtParentID.Text); newCategory.CategoryName =
txtCategoryName.Text; newCategory.UpdateCategory();
gridviewCategories.SetEditRow(-1); bindGridViewCategories(); }
protected void gridviewCategories_RowUpdated(object sender,
GridViewUpdatedEventArgs e) { gridviewCategories.SetEditRow(-1);
bindGridViewCategories(); } protected void
gridviewCategories_RowDeleting(object sender,
GridViewDeleteEventArgs e) { int editrowindex = e.RowIndex; Label
lblCategoryID =
(Label)gridviewCategories.Rows[editrowindex].Cells[0].FindControl("lblCategoryID");
clsItem newCategory = new clsItem(); newCategory.CategoryID =
int.Parse(lblCategoryID.Text); newCategory.deleteCategory();
bindGridViewCategories(); } protected void
gridviewCategories_SelectedIndexChanged(object sender, EventArgs e)
{ }}ViewItem.aspx.csusing System;using
System.Collections.Generic;using System.Linq;using System.Web;using
System.Web.UI;using System.Web.UI.WebControls;using
System.Data;public partial class ViewItem : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e) { if
(Session["myuser"] != null) { Label lblName =
(Label)this.Master.FindControl("lblName"); clsUser obj =
(clsUser)Session["myuser"]; lblName.Text = "Welcome " + obj.Name; }
if (this.IsPostBack == false) { BindGridView(); } } protected void
ImageButton1_Click(object sender, ImageClickEventArgs e) { }
private void BindGridView() { clsItem objitem = new clsItem();
DataSet ds = objitem.getAllItems(); GridView2.DataSource =
ds.Tables[0]; GridView2.DataBind(); } protected void
GridView2_RowEditing(object sender, GridViewEditEventArgs e) { int
editrowindex = e.NewEditIndex; GridView2.EditIndex = editrowindex;
BindGridView(); } protected void GridView2_RowUpdating(object
sender, GridViewUpdateEventArgs e) { int rowno = e.RowIndex;
FileUpload newfile =
(FileUpload)GridView2.Rows[rowno].FindControl("FileUpload1");
TextBox tname =
(TextBox)GridView2.Rows[rowno].FindControl("txtname"); TextBox tdes
= (TextBox)GridView2.Rows[rowno].FindControl("txtDes"); TextBox top
= (TextBox)GridView2.Rows[rowno].FindControl("txtop"); TextBox tsbd
= (TextBox)GridView2.Rows[rowno].FindControl("txtsbd"); TextBox
tsbp = (TextBox)GridView2.Rows[rowno].FindControl("txtsbp");
TextBox ted = (TextBox)GridView2.Rows[rowno].FindControl("txtebd");
Label tii = (Label)GridView2.Rows[rowno].FindControl("Label1");
clsItem newItem = new clsItem(); newItem.Item_Name = tname.Text;
newItem.OriginalPrice = float.Parse(top.Text);
newItem.StartBidPrice = float.Parse(tsbp.Text);
newItem.StartBidDate =tsbd.Text; newItem.EndDate =ted.Text ;
newItem.Description = tdes.Text; newItem.ItemID =int.Parse(
tii.Text); String pic_filename = ""; if (newfile.HasFile) {
pic_filename =
System.IO.Path.GetFileName(newfile.PostedFile.FileName); String[]
arrfile = pic_filename.Split('.'); pic_filename = arrfile[0] +
DateTime.Now.ToString("hhmmyyyyMMdd") + "." + arrfile[1]; string
serverpath = Server.MapPath("itemImages\\" + pic_filename);
newfile.PostedFile.SaveAs(serverpath); } newItem.Photo =
pic_filename; int check = newItem.updateitems();
GridView2.SetEditRow(-1); BindGridView(); } protected void
GridView2_RowDeleting(object sender, GridViewDeleteEventArgs e) {
int editrowindex = e.RowIndex; Label tii =
(Label)GridView2.Rows[editrowindex].FindControl("lblii"); clsItem
delitem = new clsItem(); delitem.ItemID = int.Parse(tii.Text); int
res=delitem.deleteitem(); BindGridView(); } protected void
GridView2_RowCancelingEdit(object sender,
GridViewCancelEditEventArgs e) { GridView2.SetEditRow(-1);
BindGridView(); } protected void
GridView2_SelectedIndexChanged(object sender, EventArgs e) { }}
ViewItemCategory.aspx.csusing System;using
System.Collections.Generic;using System.Linq;using System.Web;using
System.Web.UI;using System.Web.UI.WebControls;using
System.Data;public partial class ViewItemDetails :
System.Web.UI.Page{ public int itemID { get; set; } protected void
Page_Load(object sender, EventArgs e) { if
(Request.QueryString["ID"] != null) { itemID =
int.Parse(Request.QueryString["ID"]); } Label lblName =
(Label)this.Master.FindControl("lbluser"); HyperLink hp =
(HyperLink)this.Master.FindControl("logout"); if (Session["myuser"]
!= null) { clsUser obj = (clsUser)Session["myuser"]; lblName.Text =
"Welcome " + obj.Name; hp.Visible = true; } BindData(itemID);
ImageButton1.Visible = true; Label2.Visible = false; } public void
BindData(int itemID) { clsItem obj = new clsItem(); DataSet
ds=obj.getItem(itemID); foreach (DataRow dr in ds.Tables[0].Rows) {
lblName.Text = dr["itemName"].ToString(); lblBidPrice.Text =
dr["Highest_Bid"].ToString(); lblOPrice.Text =
dr["OriginalPrice"].ToString(); lblDescription.Text =
dr["Description"].ToString(); String TimeLeft =
(DateTime.Parse(dr["EndDate"].ToString()) -
DateTime.Now).ToString(); String[] arr = TimeLeft.Split(':'); for
(int i = 0; i < arr.Length; i++) { if (arr[i].IndexOf(".") != -1
) { string[] arrsub = arr[i].Split('.'); if (i != arr.Length - 1)
lblTimeLeft.Text = lblTimeLeft.Text + arrsub[0].ToString() + ":" +
arrsub[1].Substring(0, 2).ToString() + ":"; else lblTimeLeft.Text =
lblTimeLeft.Text + arrsub[0].ToString() + ":"; } else
lblTimeLeft.Text = lblTimeLeft.Text + arr[i].ToString() + ":"; }
imagePhoto.ImageUrl="itemImages\\"+dr["Photo"].ToString(); } }
protected void ImageButton1_Click(object sender,
ImageClickEventArgs e) { Label2.Visible = false; Label1.Visible =
true; txtbid.Visible = true; ImageButton2.Visible = true;
ImageButton1.Visible = false; if (Session["myuser"] == null) {
Response.Redirect("Login.aspx?ni=1"+"&itemID="+itemID); } }
protected void ImageButton2_Click(object sender,
ImageClickEventArgs e) { Place_Bid(); } private void Place_Bid() {
clsUser obj = (clsUser)Session["myuser"]; float currbid =
float.Parse(txtbid.Text); float higbid =
float.Parse(lblBidPrice.Text); if (currbid > higbid) { int res =
0; String query = "select no_of_bids from tblItems where itemID='"
+ itemID + "'"; DataSet ds = clsDAL.getData(query); foreach
(DataRow dr in ds.Tables[0].Rows) { int no_of_bids =
int.Parse(dr["no_of_bids"].ToString()); no_of_bids = no_of_bids +
1; query = "update tblItems set Highest_Bid='" + currbid +
"',no_of_bids='" + no_of_bids + "' where itemID='" + itemID + "'";
res = clsDAL.InsertUpdateDelete(query); } int res1 = 0; query =
"select no_of_biddings from tblUsername where username='" +
obj.Name + "'"; ds = clsDAL.getData(query); foreach (DataRow dr in
ds.Tables[0].Rows) { int no_of_biddings =
int.Parse(dr["no_of_biddings"].ToString()); no_of_biddings =
no_of_biddings + 1; query = "update tblUsername set
no_of_biddings='" + no_of_biddings + "' where username='" +
obj.Name + "'"; res = clsDAL.InsertUpdateDelete(query); } string un
= obj.Name; string query1 = "insert into tblBiddingInfo values('" +
currbid + "','" + un + "','" + itemID + "','" +
DateTime.Now.ToString() + "')"; res1 =
clsDAL.InsertUpdateDelete(query1); if (res == 1 && res1 ==
1) Response.Redirect("ViewItemDetails.aspx?ID=" + itemID); } else {
Label2.Visible = true; ImageButton1.Visible = true; Label1.Visible
= false; txtbid.Visible = false; ImageButton2.Visible = false; } }}
Certificate This is to certify that Md.Prince, Rittika Guha, Priti
Prasad , Satyajeet Nayak of Heritage Institute Of Technology,
registration number: 121260110149,121260110160,121260110155
recpectively have successfully completed a project on E-Auction
Management System using ASP.NET under the guidance of Mr. Ashok
Gupta. ------------------------------------ ASHOK GUPTA Globsyn
Finishing School (a division of Globsyn Skills)