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(); }