private void Load_PortageBill() { try { string _SortOrderColumns = "DOA_HomePort , RANK_SORT_ORDER "; Dictionary <string, UDCHyperLink> DicLink = new Dictionary <string, UDCHyperLink>(); lblPageTitle.Text = "Portage Bill : " + Convert.ToString(ViewState["Vessel_Name"]) + " - " + DateTime.Parse(ViewState["PBDt"].ToString()).ToString("MMM-yyyy"); UDCHyperLink alink = new UDCHyperLink(); alink.Target = "_blank"; alink.NaviagteURL = "../crew/CrewDetails.aspx"; alink.QueryStringDataColumn = new string[] { "VoyageID", "CrewID" }; alink.QueryStringText = new string[] { "VoyageID", "ID" }; DicLink.Add("Code", alink); DataSet dsPb = BLL_PB_PortageBill.Get_PortageBill(Convert.ToInt32(DateTime.Parse(ViewState["PBDt"].ToString()).Month), Convert.ToInt32(DateTime.Parse(ViewState["PBDt"].ToString()).Year), Convert.ToInt32(ViewState["Vessel_ID"]), UDFLib.ConvertStringToNull(null), 0); dtcomment = dsPb.Tables["Comment"]; dtEntryType = dsPb.Tables["EntryType"]; DataTable dtpb = UDFLib.PivotTable("Description", "Amount", "Sort_Order", new string[] { "VOYAGEID", "PBMONTH", "PBYEAR" }, new string[] { "VOYAGEID", "PBMONTH", "PBYEAR", "RANK_SORT_ORDER", "IsFinalized", "DOA_HomePort", "RANK_SORT_ORDER", "Amount", "Description", "Sort_Order", "CrewID" }, _SortOrderColumns, DicLink, dsPb.Tables["Data"] ); totalEarnID = dtpb.Columns.IndexOf("Total Earning"); totalDedID = dtpb.Columns.IndexOf("Total Deduction"); BFid = dtpb.Columns.IndexOf("balance"); dtpb.DefaultView.RowFilter = "rank <> ''"; DataTable dt = dtpb.DefaultView.ToTable(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { if (!string.IsNullOrEmpty(dr["From"].ToString())) { dr["From"] = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dr["From"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } if (!string.IsNullOrEmpty(dr["To"].ToString())) { dr["To"] = UDFLib.ConvertUserDateFormat(Convert.ToDateTime(dr["To"].ToString()).ToString("dd/MM/yyyy"), UDFLib.GetDateFormat()); } } } GridViewPB.DataSource = dt; GridViewPB.DataBind(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void Load_PB_Received() { int Fleet_ID = UDFLib.ConvertToInteger(ddlFleet.SelectedValue); int Vessel_ID = UDFLib.ConvertToInteger(ddlVessel.SelectedValue); int?Month = UDFLib.ConvertIntegerToNull(ddlMonth.SelectedValue); int?Year = UDFLib.ConvertIntegerToNull(ddlYear.SelectedValue); int iscount = ucCustomPagerPB.isCountRecord; GridViewPB.DataSource = BLL_PB_PortageBill.Get_PortageBills(Fleet_ID, Vessel_ID, Month, Year, ucCustomPagerPB.CurrentPageIndex, ucCustomPagerPB.PageSize, ref iscount); GridViewPB.DataBind(); ucCustomPagerPB.CountTotalRec = iscount.ToString(); ucCustomPagerPB.BuildPager(); }