protected void EventListBox_SelectedIndexChanged(object sender, EventArgs e) { String sqlQuery = "select * from Event where EventID = " + EventListBox.SelectedItem.Value; String sqlQuery1 = "select S.StaffID, S.FirstName + ' ' + S.LastName as Name from Staff S inner join EventAttendees E on E.StaffID = S.StaffID where EventID = " + EventListBox.SelectedItem.Value; //Get connection string from web.config file string strcon = ConfigurationManager.ConnectionStrings["CARESconnection"].ConnectionString; //create new sqlconnection and connection to database by using connection string from web.config file SqlConnection con = new SqlConnection(strcon); con.Open(); SqlDataAdapter sqlAdapter = new SqlDataAdapter(sqlQuery, con); SqlDataAdapter sqlAdapter1 = new SqlDataAdapter(sqlQuery1, con); DataSet ds = new DataSet(); sqlAdapter.Fill(ds); FormView4.DataSource = ds; FormView4.DataBind(); DataTable dt = new DataTable(); sqlAdapter1.Fill(dt); if (dt.Rows.Count > 0) { WorkerListLabel.Text = "Employees Attending Event: "; WorkerListBox.DataSource = dt; EventListBox.DataValueField = "StaffID"; WorkerListBox.DataTextField = "Name"; WorkerListBox.DataBind(); } con.Close(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal1();", true); }
eticaretDataContext et = new eticaretDataContext(); // data context nesnemizi olusturdur. protected void Page_Load(object sender, EventArgs e) { stokvaryok();// Ürün stok var yok fonksiyonun çağırdık. // Veritabanımıza baglandık tabloları birleştirerek çünkü markaAD adlı kolonumuz Urunler tablosunda yoktu. //Ona ulasmak içinde Ürünler tablosu ile markalar Tablosunu birleştirdik. var urun = (from u in et.Urunlers.Where(v => v.UrunID == Convert.ToInt32(Request.QueryString["id"].ToString())) join u2 in et.Markalars on u.MarkaID equals u2.MarkaID select new { u.UrunID, u.UrunAD, u.UrunDetay, u.UrunFiyat, u.KDV, u.Resim1, u.Resim2, u.Resim3, u.Resim4, u.Resim5, u.Video, u.Taksit, u2.MarkaAD }); //Ürün Adımızı almak için veritabanımıza bağlandık. var urunad = et.Urunlers.Where(v => v.UrunID == int.Parse(Request.QueryString["id"])).FirstOrDefault(); lblAD.Text = urunad.UrunAD; // Ürün adımızı veritabanından alarak Label'ımıza atadık. FormView1.DataSource = urun; // sonucumuzu FormView'umuza attık. FormView1.DataBind(); FormView2.DataSource = urun; // Ürün Resimlerinin gösterimi için FormView2 ile bağlantımızı kurduk. FormView2.DataBind(); FormView3.DataSource = urun; FormView3.DataBind(); FormView4.DataSource = urun; FormView4.DataBind(); FormView5.DataSource = urun; FormView5.DataBind(); FormView6.DataSource = urun; FormView6.DataBind(); yorumgetir(); }
protected void GridView4_SelectedIndexChanged(object sender, EventArgs e) { DataKey dk = GridView4.SelectedDataKey; int a = 0; FormView4.PageIndex = 0; FormView4.DataBind(); while (FormView4.DataKey.Value.ToString() != dk.Value.ToString() && a < FormView4.PageCount) { if (a + 1 < FormView4.PageCount) { FormView4.PageIndex++; FormView4.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { BookBL bl = new BookBL(); GridView1.DataSource = bl.new_Message(); GridView1.DataBind(); DataList1.DataSource = bl.chinese_Book("1"); DataList1.DataBind(); DataList2.DataSource = bl.chinese_Book("2"); DataList2.DataBind(); FormView2.DataSource = bl.chinese_Book("1"); FormView2.DataBind(); FormView5.DataSource = bl.chinese_Book("2"); FormView5.DataBind(); FormView7.DataSource = bl.chinese_Book("3"); FormView7.DataBind(); FormView1.DataSource = bl.everyday_Book(); FormView1.DataBind(); FormView4.DataSource = bl.book_top1("1"); FormView4.DataBind(); FormView3.DataSource = bl.book_top1("2"); FormView3.DataBind(); FormView6.DataSource = bl.book_top1("3"); FormView6.DataBind(); bl.book_Hit("1", HyperLink19, HyperLink20, HyperLink21, HyperLink22, HyperLink23, HyperLink24, HyperLink25, HyperLink26, HyperLink27); bl.book_Hit("2", HyperLink28, HyperLink29, HyperLink30, HyperLink31, HyperLink32, HyperLink33, HyperLink34, HyperLink35, HyperLink36); bl.book_Hit("3", HyperLink38, HyperLink39, HyperLink40, HyperLink41, HyperLink42, HyperLink43, HyperLink44, HyperLink45, HyperLink46); }
public void ViewVesselDetails(int Key) { DataTable dtVessel = objBLL.GetVesselDetails_ByID(Key); FormView1.DataSource = dtVessel; FormView1.DataBind(); FormView3.DataSource = dtVessel; FormView3.DataBind(); FormView4.DataSource = dtVessel; FormView4.DataBind(); FormView5.DataSource = dtVessel; FormView5.DataBind(); FormView6.DataSource = dtVessel; FormView6.DataBind(); FormView7.DataSource = dtVessel; FormView7.DataBind(); ShipImg.ImageUrl = "~/Vessel/ShipImage/" + dtVessel.Rows[0]["Vessel_Image"].ToString(); TankImg.ImageUrl = "~/Vessel/shipLayout/" + dtVessel.Rows[0]["Vessel_Tank_Image"].ToString(); lblShipName.Text = dtVessel.Rows[0]["Vessel_Short_Name"].ToString(); DataSet ds = objBLL.GetInmarsatValues_ForVesselID(Key); DataTable dt1 = ds.Tables[0]; DataTable dt2 = ds.Tables[0]; dt1 = RemoveDuplicateRows(dt1, "terminal"); dt2 = RemoveDuplicateRows(dt2, "channel"); // GridView1.DataSource = ds.Tables["Dtl_IID_INMARSAT"].DefaultView; // GridView1.DataBind(); //DataTable SourceDt = new DataTable(); for (int i = 0; i < dt1.Rows.Count + 1; i++) { TableRow tr = new TableRow(); for (int j = 0; j < 5; j++) { TableCell tc = new TableCell(); Label lbl = new Label(); tc.Text = ""; tc.BorderWidth = 1; tr.Cells.Add(tc); if (j == 0 && i > 0) { tc.Text = "<b>Inmarsat-</b>" + dt1.Rows[i - 1]["terminal"].ToString(); } } tr.BorderStyle = BorderStyle.Solid; Table1.Rows.Add(tr); if (i >= 1) { switch (ds.Tables[0].Rows[i - 1]["Channel"].ToString()) { case "Telex": { Table1.Rows[i].Cells[1].Text = ds.Tables[0].Rows[i - 1]["Phone"].ToString(); break; } case "Telephone": { Table1.Rows[i].Cells[2].Text = ds.Tables[0].Rows[i - 1]["Phone"].ToString(); break; } case "Fax": { Table1.Rows[i].Cells[3].Text = ds.Tables[0].Rows[i - 1]["Phone"].ToString(); break; } case "Data": { Table1.Rows[i].Cells[4].Text = ds.Tables[0].Rows[i - 1]["Phone"].ToString(); break; } } } } Table1.Rows[0].Cells[0].Text = ""; Table1.Rows[0].Cells[1].Text = "<b>Telex</b>"; Table1.Rows[0].Cells[2].Text = "<b>Telephone</b>"; Table1.Rows[0].Cells[3].Text = "<b>Fax</b>"; Table1.Rows[0].Cells[4].Text = "<b>Data</b>"; //GridView1.DataSource = dt2; //GridView1.DataBind(); }