/// <summary> /// Method use to intialize the default Quarter and Default KPI for selected /// </summary> protected void IntializeControls() { DataTable dt = objKPI.Get_Vetting_KPI_List(); int firstKPI_Id = 0; string Kpi_Name = ""; if (dt.Rows.Count > 0) { firstKPI_Id = Convert.ToInt16(dt.Rows[0]["KPI_ID"]); Kpi_Name = dt.Rows[0]["Name"].ToString(); ViewState["KPI_ID"] = firstKPI_Id; hdnKpi_ID.Value = firstKPI_Id.ToString(); hdnKpi_Name.Value = Kpi_Name; DateTime EndDate = Convert.ToDateTime(UDFLib.ConvertToDefaultDt(txtEndDate.Text)); int IMonth = 0; int Year = 2017; int Qtr = 1; IMonth = EndDate.Month; Year = EndDate.Year; if (IMonth < 4) { Qtr = 1; } else if ((IMonth > 3 && IMonth <= 6)) { Qtr = 2; } else if ((IMonth > 6 && IMonth <= 9)) { Qtr = 3; } else { Qtr = 4; } hdnQtr.Value = "Q" + Qtr.ToString() + "-" + Year.ToString(); } }