protected void BindAllotmentsToVerify(DataRow dr) { try { JSConfirmStatus.Value = "false"; if (dr != null) { CrewID = int.Parse(dr["id"].ToString()); ViewState["PBMonth"] = Convert.ToDateTime(dr["PBDate"]).Month; ViewState["PBYear"] = Convert.ToDateTime(dr["PBDate"]).Year; ViewState["PBYearPrev"] = Convert.ToDateTime(dr["PBDate"]).AddMonths(-1).Year; ViewState["PBMonthPrev"] = Convert.ToDateTime(dr["PBDate"]).AddMonths(-1).Month; AllotmentID = int.Parse(dr["AllotmentID"].ToString()); } lblPortageBilldate.Text = "Portage Bill : " + ViewState["PBMonth"].ToString() + " / " + ViewState["PBYear"].ToString() + " [ Current ]"; lblPrevMonthPBDate.Text = "Portage Bill : " + ViewState["PBMonthPrev"].ToString() + " / " + ViewState["PBYearPrev"].ToString() + " [ Previous ]"; frmvCrewDetails.DataSource = BLL_PB_PortageBill.Get_Allotments(int.Parse(ddlFleet.SelectedValue), int.Parse(ddlVessel.SelectedValue), ViewState["PBMonth"].ToString(), ViewState["PBYear"].ToString(), int.Parse(ddlApproval.SelectedValue), int.Parse(DDLBank.SelectedValue), int.Parse(ddlStatus.SelectedValue), txtSearch.Text, CrewID, null, AllotmentID); frmvCrewDetails.DataBind(); DataSet dtAllAllotment = BLL_PB_PortageBill.Get_Allotments_ByCrewID(int.Parse(CrewID.ToString()), Convert.ToInt32(ViewState["PBMonth"]), Convert.ToInt32(ViewState["PBYear"])); if (dtAllAllotment.Tables[0].Rows.Count > 1) { (frmvCrewDetails.FindControl("btnVerifyAllot") as Button).Attributes.Add("onclick", "AlertForMorethanOneAllotments('" + dtAllAllotment.Tables[1].Rows[0][0].ToString() + "','" + (frmvCrewDetails.FindControl("btnVerifyAllot") as Button).ClientID + "');return false;"); } DataSet ds = BLL_PB_PortageBill.ACC_Get_CrewWages_ByMonth(int.Parse(CrewID.ToString()), Convert.ToInt32(ViewState["PBMonth"]), Convert.ToInt32(ViewState["PBYear"])); gvJoiningWages.DataSource = ds.Tables[1]; gvJoiningWages.DataBind(); if (ds.Tables[1].Rows.Count > 1) { gvJoiningWages.Rows[gvJoiningWages.Rows.Count - 1].Font.Bold = true; } gvBortagebill.DataSource = ds.Tables[0]; gvBortagebill.DataBind(); if (ds.Tables[0].Rows.Count > 1) { gvBortagebill.Rows[gvBortagebill.Rows.Count - 1].Font.Bold = true; } gvPrevMonthPB.DataSource = ds.Tables[2]; gvPrevMonthPB.DataBind(); if (ds.Tables[2].Rows.Count > 1) { gvPrevMonthPB.Rows[gvPrevMonthPB.Rows.Count - 1].Font.Bold = true; } } catch (Exception ex) { throw ex; } }