protected void BindVesselList() { // DataTable dt = objKPI.Get_KPI_DetailGoals(-1).Tables[0]; BLL_Infra_VesselLib bll_Vessel = new BLL_Infra_VesselLib(); BLL_TMSA_KPI bll_KPI = new BLL_TMSA_KPI(); DataTable dt = bll_Vessel.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); dt.Columns.Remove("code"); dt.Columns.Remove("name"); dt.Columns.Remove("fleetname"); dt.Columns.Remove("Super_MailID"); dt.Columns.Remove("TechTeam_MailID"); dt.Columns.Remove("Vessel_Owner"); dt.Columns.Remove("Vessel_Manager"); DataTable dtable = bll_KPI.Get_Fleet_Vessel_List(dt, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), GetSessionUserID()); ddlvessel.DataSource = dtable; ddlvessel.DataTextField = "VESSEL_NAME"; ddlvessel.DataValueField = "VESSEL_ID"; ddlvessel.DataBind(); ddlvessel.Items.Insert(0, new ListItem("--Select--", "0")); if (dtable != null && dtable.Rows.Count > 0) { ddlvessel.SelectedIndex = 1; hiddenVessel.Value = "1"; } }
public void Load_VesselList() { try { BLL_TMSA_KPI objKPI = new BLL_TMSA_KPI(); DataTable dtVessel = objKPI.Get_Fleet_Vessel_List((DataTable)Session["sFleet"], Convert.ToInt32(Session["USERCOMPANYID"].ToString()), Convert.ToInt32(Session["USERCOMPANYID"].ToString()), GetSessionUserID()); foreach (DataRow dr in dtVessel.Rows) { if (dr["Vessel_Id"] == "11" || dr["Vessel_Id"] == "13") { dtVessel.Rows.Remove(dr); } } DDLVessel.DataSource = dtVessel; DDLVessel.DataTextField = "Vessel_name"; DDLVessel.DataValueField = "Vessel_id"; DDLVessel.DataBind(); if (dtVessel.Rows.Count > 0) { for (int i = 0; i < dtVessel.Rows.Count; i++) { if (dtVessel.Rows[i]["Vessel_id"] != null) { DDLVessel.SelectItems(new string[] { dtVessel.Rows[i]["Vessel_id"].ToString() }); } } } Session["Vessel_Id"] = DDLVessel.SelectedValues; } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
/// <summary> /// Method to load fleet and vessels /// </summary> protected void BindVessel() { try { BLL_Infra_VesselLib bll_Vessel = new BLL_Infra_VesselLib(); BLL_TMSA_KPI bll_KPI = new BLL_TMSA_KPI(); DataTable dt = bll_Vessel.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString())); dt.Columns.Remove("code"); dt.Columns.Remove("name"); dt.Columns.Remove("fleetname"); dt.Columns.Remove("Super_MailID"); dt.Columns.Remove("TechTeam_MailID"); dt.Columns.Remove("Vessel_Owner"); dt.Columns.Remove("Vessel_Manager"); DataTable dtable = bll_KPI.Get_Fleet_Vessel_List(dt, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), GetSessionUserID()); ddlVessel.DataSource = dtable; ddlVessel.DataTextField = "Vessel_Name"; ddlVessel.DataValueField = "Vessel_Id"; ddlVessel.DataBind(); ddlVessel.Items.Insert(0, new ListItem("--Select--", "0")); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
/// <summary> /// Method to get the category wise retention data /// Inputs of RankIds and Years as querystring /// </summary> protected void BindRetentionDetail() { try { BLL_TMSA_KPI objKPI = new BLL_TMSA_KPI(); Category_Id = Convert.ToInt32(Request.QueryString[0]); string RankIDs = Request.QueryString[1]; string Year = Request.QueryString[2]; lblformula.Text = "Formula : 100 - (PI 41- PI 16)/PI 06*100"; DataTable dtRetention = objKPI.Search_CrewRetention(RankIDs, Year, Category_Id).Tables[0]; if (Request.QueryString["Category"] != null) { ltTitle.Text = "Crew Retention Details : " + Request.QueryString["Category"]; } if (dtRetention.Rows.Count > 0) { gvCategory.DataSource = dtRetention; gvCategory.DataBind(); } } catch (Exception ex) { string ERR = ex.ToString(); } }
protected void bindVoyage() { BLL_TMSA_KPI objKPI = new BLL_TMSA_KPI(); int Vessel_Id = Convert.ToInt32(ddlvessel.SelectedValue); if (txtStartDate.Text != "" && txtEndDate.Text != "") { DateTime Startdate = Convert.ToDateTime(UDFLib.ConvertToDefaultDt(txtStartDate.Text)); DateTime EndDate = Convert.ToDateTime(UDFLib.ConvertToDefaultDt(txtEndDate.Text)); DataTable dt = objKPI.GetVoyageList(Vessel_Id, Startdate, EndDate); ddlVoyage.DataSource = dt; ddlVoyage.DataTextField = "VOYAGE"; ddlVoyage.DataValueField = "TelID"; ddlVoyage.DataBind(); } }
/// <summary> /// Method is used to Export report data to excel file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnExportToExcel_Click(object sender, ImageClickEventArgs e) { try { BLL_TMSA_KPI objKPI = new BLL_TMSA_KPI(); string Elements = hdnElements.Value; string Stages = hdnStages.Value; string Levels = hdnLevels.Value; string version = hdnVersion.Value; int iVersionNo = Convert.ToInt16(version); DataTable dt = objTMSA.Search_ExportToExcelOverallReport(Elements, Stages, Levels, iVersionNo).Tables[0]; GridView GridView1 = new GridView(); GridView1.AllowPaging = false; GridView1.DataSource = dt; GridView1.DataBind(); Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=DataTable.xls"); Response.Charset = ""; Response.ContentType = "application/vnd.ms-excel"; StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); for (int i = 0; i < GridView1.Rows.Count; i++) { GridView1.Rows[i].Attributes.Add("class", "textmode"); } GridView1.RenderControl(hw); string style = @"<style> .textmode { mso-number-format:\@; } </style>"; Response.Write(style); Response.Output.Write(sw.ToString()); Response.Flush(); Response.End(); } catch (Exception ex) { UDFLib.WriteExceptionLog(ex); } }
protected void imgADD_Click(object sender, ImageClickEventArgs e) { if (ddlVoyage.SelectedItem != null) { if (!listVoyage.Items.Contains(ddlVoyage.SelectedItem)) { listVoyage.Items.Add(ddlVoyage.SelectedItem); } BLL_TMSA_KPI objKPI = new BLL_TMSA_KPI(); int Vessel_Id = Convert.ToInt32(ddlvessel.SelectedValue); if (txtStartDate.Text != "" && txtEndDate.Text != "") { DateTime Startdate = Convert.ToDateTime(UDFLib.ConvertToDefaultDt(txtStartDate.Text)); DateTime EndDate = Convert.ToDateTime(UDFLib.ConvertToDefaultDt(txtEndDate.Text)); DataTable dtable = objKPI.GetVoyageList(Vessel_Id, Startdate, EndDate); for (int i = 0; i < listVoyage.Items.Count; i++) { DataRow[] result = dtable.Select("Voyage = '" + listVoyage.Items[i] + "'"); foreach (DataRow row in result) { dtable.Rows.Remove(row); } } ddlVoyage.DataSource = dtable; ddlVoyage.DataTextField = "Voyage"; ddlVoyage.DataValueField = "TelID"; ddlVoyage.DataBind(); } hdnEnd.Value = ""; hdnStart.Value = ""; BindVoyageData(); } }