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 Page_Load(object sender, EventArgs e) { if (Request.QueryString["book_id"] == null) { Response.Redirect("index.aspx"); } else { BookBL bookBL = new BookBL(); FormView1.DataSource = bookBL.product(Request.QueryString["book_id"].ToString()); FormView1.DataBind(); string author = ((HyperLink)FormView1.FindControl("HyperLink4")).Text.ToString(); Label15.Text = author; DataList1.DataSource = bookBL.authorBook(author); DataList1.DataBind(); //書籍內容 FormView2.DataSource = bookBL.product(Request.QueryString["book_id"].ToString()); FormView2.DataBind(); //書籍簡介 FormView3.DataSource = bookBL.product(Request.QueryString["book_id"].ToString()); FormView3.DataBind(); //留言板 GridView1.DataSource = bookBL.product_message(Request.QueryString["book_id"].ToString()); GridView1.DataBind(); } }
public void FormView3_InsertItem(PhysicalRecord physrecord) { if (ModelState.IsValid) { try { physrecord.RecordID = Id; var pricevalue = ((TextBox)FormView3.FindControl("PriceTextBox")).Text; //TODO fixa så det funkar utan InvariantCulture var Price = decimal.Parse(pricevalue, CultureInfo.InvariantCulture); physrecord.PriceAtPurchase = Price; Service.SavePhysicalRecord(physrecord); //RecordTypeID 3 är 'multi', både som fysisk och digital Record.RecordTypeID = 3; Service.SaveRecord(Record); Response.RedirectToRoute("RecordDetails", new { id = physrecord.RecordID }); } catch { ModelState.AddModelError(String.Empty, "Ett fel inträffade när skivan skulle läggas in"); } } }
protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Upd") { HEdit.Value = e.CommandArgument.ToString(); FormView3.ChangeMode(FormViewMode.Edit); } }
protected void DeluxePager1_CommonPageIndexChanged(object sender, EventArgs e) { DataSet ds = ObjData.GetPagerList(DeluxePager1.PageSize, DeluxePager1.PageIndex); int recordCount = ObjData.GetOrdersCount(); DeluxePager1.RecordCount = recordCount; FormView3.DataSource = ds; FormView3.DataBind(); }
private void InitializePagers() { DeluxePager1.PageIndex = 0; DataSet ds = ObjData.GetPagerList(DeluxePager1.PageSize, DeluxePager1.PageIndex); int recordCount = ObjData.GetOrdersCount(); DeluxePager1.RecordCount = recordCount; FormView3.DataSource = ds; FormView3.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { Page.MaintainScrollPositionOnPostBack = true; String userName = Session["username"].ToString(); lblUser.Text = userName.ToString(); Label RegionLabel = FormView3.FindControl("RegionLabel") as Label; lblRegion.Text = RegionLabel.Text; //Label lblEmail = FormView2.FindControl("lblEmail") as Label; }
protected void GridView3_SelectedIndexChanged(object sender, EventArgs e) { DataKey dk = GridView3.SelectedDataKey; int a = 0; FormView3.PageIndex = 0; FormView3.DataBind(); while (FormView3.DataKey.Value.ToString() != dk.Value.ToString() && a < FormView3.PageCount) { if (a + 1 < FormView3.PageCount) { FormView3.PageIndex++; FormView3.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(); }