protected void Page_Load(object sender, EventArgs e) { // string v2 = Request.QueryString["vname"]; string main_vname = Session["main_vname"].ToString(); // v2 = Session["vn"].ToString(); Label3.Visible = true; Label3.Text = main_vname; vendormenus.vendor_menus r1 = new vendormenus.vendor_menus(); // goback.Text = "<a href='vendor_single.aspx' class='green'> Go Back</a>"; ArrayList a = new ArrayList(r1.menu_retrieve(main_vname)); ArrayList b = new ArrayList(); b = (ArrayList)a; string[,] data = new string[100, 7]; int iterator = 0; foreach (string c in b) { string[] row = c.Split('^'); data[iterator, 0] = row[0]; data[iterator, 1] = row[1]; data[iterator, 2] = row[2]; data[iterator, 3] = row[3]; data[iterator, 4] = row[4]; iterator++; } DataTable newsDataTable = new DataTable(); // add some columns to our datatable newsDataTable.Columns.Add("itemname"); newsDataTable.Columns.Add("itemprice"); newsDataTable.Columns.Add("itemtype"); newsDataTable.Columns.Add("itemdesc"); newsDataTable.Columns.Add("itemid"); // adding new rows for (int i = 0; i < iterator; i++) { DataRow newsDataRow = newsDataTable.NewRow(); newsDataRow["itemname"] = data[i, 0]; newsDataRow["itemprice"] = data[i, 1]; newsDataRow["itemtype"] = data[i, 2]; newsDataRow["itemdesc"] = data[i, 3]; newsDataRow["itemid"] = data[i, 4]; newsDataTable.Rows.Add(newsDataRow); } // bind our datatable to our repeater venmenu.DataSource = newsDataTable; venmenu.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { vendormenus.vendor_menus r1 = new vendormenus.vendor_menus(); string main_vname = ""; if (Session["main_vname"] == null) { Response.Redirect("login.aspx"); } else { main_vname = Session["main_vname"].ToString(); } ArrayList a = new ArrayList(r1.menu_retrieve(main_vname)); ArrayList b = new ArrayList(); b = (ArrayList)a; string[,] data = new string[100, 7]; int iterator = 0; foreach (string c in b) { string[] row = c.Split('^'); data[iterator, 0] = row[0]; data[iterator, 1] = row[1]; data[iterator, 2] = row[2]; data[iterator, 3] = row[3]; data[iterator, 4] = row[4]; iterator++; } DataTable newsDataTable = new DataTable(); // add some columns to our datatable newsDataTable.Columns.Add("itemname"); newsDataTable.Columns.Add("itemprice"); newsDataTable.Columns.Add("itemtype"); newsDataTable.Columns.Add("itemdesc"); newsDataTable.Columns.Add("itemid"); // adding new rows for (int i = 0; i < iterator; i++) { DataRow newsDataRow = newsDataTable.NewRow(); newsDataRow["itemname"] = data[i, 0]; newsDataRow["itemprice"] = data[i, 1]; newsDataRow["itemtype"] = data[i, 2]; newsDataRow["itemdesc"] = data[i, 3]; newsDataRow["itemid"] = data[i, 4]; newsDataTable.Rows.Add(newsDataRow); } // bind our datatable to our repeater menu.DataSource = newsDataTable; menu.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { string main_vname = Session["main_vname"].ToString(); vendormenus.vendor_menus r2 = new vendormenus.vendor_menus(); int status = r2.item_add(name.Text, price.Text, type.Text, desc.Text, main_vname); if (status == 1) { Label1.Visible = true; Label1.Text = "Item Added Successfully"; } else { Label1.Visible = true; Label1.Text = "Please do try again"; } }
protected void Page_Load(object sender, EventArgs e) { string service = "Photography"; if (service != null) { vendormenus.vendor_menus r1 = new vendormenus.vendor_menus(); ArrayList a = new ArrayList(r1.vendor_service(service)); ArrayList b = new ArrayList(); b = (ArrayList)a; string[,] data = new string[100, 10]; int iterator = 0; foreach (string c in b) { string[] row = c.Split('^'); data[iterator, 0] = row[0]; data[iterator, 1] = row[1]; data[iterator, 2] = row[2]; data[iterator, 3] = row[3]; data[iterator, 4] = row[4]; data[iterator, 5] = row[5]; data[iterator, 6] = row[6]; data[iterator, 7] = row[7]; iterator++; } DataTable newsDataTable = new DataTable(); // add some columns to our datatable newsDataTable.Columns.Add("vendor_name"); newsDataTable.Columns.Add("contact_no"); newsDataTable.Columns.Add("street"); newsDataTable.Columns.Add("city"); newsDataTable.Columns.Add("zipcode"); newsDataTable.Columns.Add("vendor_service"); newsDataTable.Columns.Add("officetimings"); newsDataTable.Columns.Add("email"); // adding new rows for (int i = 0; i < iterator; i++) { DataRow newsDataRow = newsDataTable.NewRow(); newsDataRow["vendor_name"] = data[i, 0]; newsDataRow["contact_no"] = data[i, 1]; newsDataRow["street"] = data[i, 2]; newsDataRow["city"] = data[i, 3]; newsDataRow["zipcode"] = data[i, 4]; newsDataRow["vendor_service"] = data[i, 5]; newsDataRow["officetimings"] = data[i, 6]; newsDataRow["email"] = data[i, 7]; newsDataTable.Rows.Add(newsDataRow); } // bind our datatable to our repeater venphoto.DataSource = newsDataTable; venphoto.DataBind(); if (iterator != 0) { } else { p1.Text = "No Vendors"; } } else { p1.Visible = true; p1.Text = "No Vendors"; } }