protected void LB_Next_Click(object sender, EventArgs e) { string[] strAMatrimonialID = null; string SQLQuery; switch (HF_Type.Value) { case "1": strAMatrimonialID = SearchEngine.Search(SearchEngine.SearchType.Simple, bool.Parse(HF_Gen.Value), sbyte.Parse(HF_AMin.Value), sbyte.Parse(HF_AMax.Value), sbyte.Parse(HF_Rel.Value), bool.Parse(HF_ISPhoto.Value), short.Parse(HF_Cst.Value), 0, (int.Parse(HF_Start.Value) + 14)); break; case "2": strAMatrimonialID = SearchEngine.Search(SearchEngine.SearchType.EducationalSearch, bool.Parse(HF_Gen.Value), sbyte.Parse(HF_AMin.Value), sbyte.Parse(HF_AMax.Value), sbyte.Parse(HF_Rel.Value), bool.Parse(HF_ISPhoto.Value), short.Parse(HF_Cst.Value), sbyte.Parse(HF_Criteria.Value), (int.Parse(HF_Start.Value) + 14)); break; case "3": strAMatrimonialID = SearchEngine.Search(SearchEngine.SearchType.OccupationSearch, bool.Parse(HF_Gen.Value), sbyte.Parse(HF_AMin.Value), sbyte.Parse(HF_AMax.Value), sbyte.Parse(HF_Rel.Value), bool.Parse(HF_ISPhoto.Value), short.Parse(HF_Cst.Value), sbyte.Parse(HF_Criteria.Value), (int.Parse(HF_Start.Value) + 14)); break; case "4": strAMatrimonialID = SearchEngine.KeyWordSearch(HF_String.Value, bool.Parse(HF_Gen.Value), (int.Parse(HF_Start.Value) + 14)); break; case "5": SQLQuery = Session[HF_String.Value].ToString(); strAMatrimonialID = SearchEngine.AdvancedSearch(SQLQuery, (int.Parse(HF_Start.Value) + 14)); break; default: ErrorLog.WriteLog("Member_SearchResult.LB_Next_Click.HF_Type.Value = " + HF_Type.Value); break; } if ((strAMatrimonialID != null) && (strAMatrimonialID[0] != "0")) { //Previous Enabled LB_Previous_1.Enabled = true; LB_Previous_2.Enabled = true; //Getting values int intStart = int.Parse(HF_Start.Value); HF_Start.Value = (intStart + 14).ToString(); int intCount = int.Parse(strAMatrimonialID[0]); int intCurrent; intCurrent = intCount - (intStart + 14); //Update Start Pointer intStart += 14; HF_Start.Value = (intStart).ToString(); if (intCurrent < 14) { LB_Next_1.Enabled = false; LB_Next_2.Enabled = false; L_Current_1.Text = (intStart + intCurrent).ToString(); L_Current_2.Text = (intStart + intCurrent).ToString(); } else { L_Current_1.Text = (intStart + 14).ToString(); L_Current_2.Text = (intStart + 14).ToString(); } //Getting SSList LoadList(strAMatrimonialID); } else { ErrorLog.WriteLog("Guest/SearchResults-LB_Next_Click"); Response.Redirect("~/Extras/ErrorReport.aspx"); } }
private void StringSearch(SearchEngine.SearchType searchType) { if ((Request.QueryString["str"] != "") || (Request.QueryString["str"] != null)) { string[] strAMatrimonialID = null; try { string SQLQuery = null; switch (searchType) { case SearchEngine.SearchType.AdvansedSearch: SQLQuery = Session[Request.QueryString["str"]].ToString(); strAMatrimonialID = SearchEngine.AdvancedSearch(SQLQuery, 0); HF_String.Value = Request.QueryString["str"]; HF_Type.Value = "5"; break; case SearchEngine.SearchType.KeyWordSearch: SQLQuery = Session[Request.QueryString["str"]].ToString(); bool boolGender = false; if (Request.QueryString["g"].ToUpper() == "TRUE") { boolGender = true; HF_Gen.Value = true.ToString(); } else { HF_Gen.Value = false.ToString(); } strAMatrimonialID = SearchEngine.KeyWordSearch(SQLQuery, boolGender, 0); HF_String.Value = Session[Request.QueryString["str"]].ToString(); HF_Type.Value = "4"; break; } } catch (Exception EX) { ErrorLog.WriteErrorLog("Member-Searchresult-StringSearch", EX); } if ((strAMatrimonialID == null) || (strAMatrimonialID[0] == "0")) { Response.Redirect("~/Guest/NoRecordFound.aspx"); } else { int intResultCount = int.Parse(strAMatrimonialID[0]); L_Last_2.Text = intResultCount.ToString(); L_Last_1.Text = intResultCount.ToString(); if (intResultCount < 14) { LB_Next_1.Enabled = false; LB_Next_2.Enabled = false; L_Current_1.Text = intResultCount.ToString(); L_Current_2.Text = intResultCount.ToString(); } else { LB_Next_1.Enabled = true; LB_Next_2.Enabled = true; L_Current_1.Text = "14"; L_Current_2.Text = "14"; } HF_Start.Value = "0"; LoadList(strAMatrimonialID); } } }