Esempio n. 1
0
        //----------------------------------------------------------------------------------
        /// <summary>
        /// Handles the PreRender event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remark>Created 10/02/2009 14:36 by jm</remark>
        //----------------------------------------------------------------------------------
        protected void Page_PreRender(object sender, EventArgs e)
        {
            try
            {
                if (SessionManager.Instance.CurrentIndex == null ||
                    SessionManager.Instance.SitecoreSearchResult == null)
                {
                    SearchResultGrid.DataSource = null;
                    SearchResultGrid.DataBind();
                    SetSearchInfoValues(0, 0);
                }
                else
                {
                    SetSearchInfoValues(SessionManager.Instance.SitecoreSearchResult.TimeElapsed,
                                        SessionManager.Instance.SitecoreSearchResult.SearchResultCollection.Count);

                    SearchResultGrid.DataSource = SessionManager.Instance.SitecoreSearchResult.AsDataTable(SessionManager.Instance.CurrentIndex.Fields, ExcludeEmptyField.Checked);
                    SearchResultGrid.DataBind();
                }
            }
            catch (Exception ex)
            {
                OnError(new ExceptionEventArgs(ex, this));
            }
        }
Esempio n. 2
0
        protected override void OnGraphicsLayerMouseUp(object sender, GraphicMouseButtonEventArgs e)
        {
            HighlightSelectedGraphic(e.Graphic);
            SearchResultGrid.SelectItem(e.Graphic);

            // Run the base's handler at last
            base.OnGraphicsLayerMouseUp(sender, e);
        }
Esempio n. 3
0
        protected override void Dispose(bool disposing)
        {
            if (SearchResultGrid != null)
            {
                SearchResultGrid.Dispose();
            }

            if (ToolBar != null)
            {
                ToolBar.Dispose();
            }

            base.Dispose(disposing);
        }
Esempio n. 4
0
 protected void Page_PreRender(object sender, EventArgs e)
 {
     if (SessionManager.Instance.LinqSearchResults == null)
     {
         SearchResultGrid.DataSource = null;
         SearchResultGrid.DataBind();
     }
     else
     {
         SearchResultGrid.DataSource = SessionManager.Instance.LinqSearchResults.AsDataTable();
         SearchResultGrid.DataBind();
     }
     SearchResultTypeLabel.Text = GetObjectType();
 }
Esempio n. 5
0
        private async void searchButton_Click(object sender, EventArgs e)
        {
            var term    = searchBox.Text;
            var results = await GitHubClientActions.SearchGitHub(term);

            searchResults = results;
            foreach (var res in searchResults.Items)
            {
                SearchResultGrid result = new SearchResultGrid {
                    FullName = res.FullName, URL = new Uri(res.Url), Stars = res.StargazersCount.ToString(), Language = res.Language, OpenIssues = res.OpenIssuesCount.ToString()
                };
                gridData.Add(result);
            }
            resultsGrid.DataSource = gridData;
        }
Esempio n. 6
0
        protected void SearchButton_Click123(object sender, EventArgs e)
        {
            myDAL objmyDAl = new myDAL();
            //   String InputName = TextBox2.Text;
            DataTable DT = new DataTable();
            int       found;

            found = objmyDAl.SearchStudentByName12345_DAL(ee, ref DT);
            if (found != 1)
            {
                Label1.Text = "There was some error";
            }
            else
            {
                //Label1.Text = "Following Messages are found";
                SearchResultGrid.DataSource = DT;
                SearchResultGrid.DataBind();
            }
        }
        protected void SearchButton_Click(object sender, EventArgs e)
        {
            myDAL     objmyDAl  = new myDAL();
            String    InputName = Name.Text;
            DataTable DT        = new DataTable();
            int       found;

            found = objmyDAl.SearchStudentByName_DAL(InputName, ref DT);
            if (found != 1)
            {
                Message.Text = "There was some error";
            }
            else
            {
                Message.Text = "Following Employees are found";
                SearchResultGrid.DataSource = DT;
                SearchResultGrid.DataBind();
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ee = (string)Session["uemail"];
            if (ee == null)
            {
                Response.Redirect("login.aspx");
            }
            myDAL     objmyDAl = new myDAL();
            DataTable DT       = new DataTable();
            int       found;

            found = objmyDAl.SearchStudentByName123_DAL(ref DT);
            if (found != 1)
            {
                Message.Text = "There was some error";
            }
            else
            {
                Message.Text = "Following Messages are found";
                SearchResultGrid.DataSource = DT;
                SearchResultGrid.DataBind();
            }
        }
Esempio n. 9
0
        protected void btnSearch_ServerClick(object sender, EventArgs e)
        {
            Connection();
            //string query = "select * from CourseCatalog";
            //SqlCommand com = new SqlCommand(query, con);

            //SqlDataReader dr;
            //dr = com.ExecuteReader();
            SqlDataAdapter da;
            DataSet        ds = new DataSet();

            // Consume the DB Stored Proc by passing the parameters
            using (SqlConnection SqlCon = new SqlConnection(constr))
            {
                try
                {
                    SqlCon.Open();

                    SqlCommand cmd = new SqlCommand("USP_GetCourseDetails", SqlCon);
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add(new SqlParameter("@CourseName", SqlDbType.VarChar));
                    cmd.Parameters["@CourseName"].Value = TxtCourseName.Text;

                    cmd.Parameters.Add(new SqlParameter("@SkillName", SqlDbType.VarChar));
                    cmd.Parameters["@SkillName"].Value = TxtSkillName.Text;

                    cmd.Parameters.Add(new SqlParameter("@ProficiencyLevel", SqlDbType.Int));
                    //cmd.Parameters["@ProficiencyLevel"].Value = String.IsNullOrEmpty(TxtProficiencyLevel.Text) ? 0 : Convert.ToInt32(TxtProficiencyLevel.Text);
                    cmd.Parameters["@ProficiencyLevel"].Value = String.IsNullOrEmpty(DrpdwnProficiencyLevel.SelectedValue) ? 0 : Convert.ToInt32(DrpdwnProficiencyLevel.SelectedValue);

                    cmd.Parameters.Add(new SqlParameter("@CourseCode", SqlDbType.VarChar));
                    cmd.Parameters["@CourseCode"].Value = TxtCourseCode.Text;

                    cmd.Parameters.Add(new SqlParameter("@CourseDescription", SqlDbType.VarChar));
                    cmd.Parameters["@CourseDescription"].Value = TxtCourseDescription.Text;

                    cmd.Parameters.Add(new SqlParameter("@LicenseNeeded", SqlDbType.VarChar));
                    cmd.Parameters["@LicenseNeeded"].Value = TxtLicenseNeeded.Text;

                    cmd.Parameters.Add(new SqlParameter("@ActivityType", SqlDbType.VarChar));
                    //cmd.Parameters["@ActivityType"].Value = TxtActivityType.Text;
                    cmd.Parameters["@ActivityType"].Value = DrpdwnActivityType.SelectedValue;



                    da = new SqlDataAdapter(cmd);
                    da.Fill(ds);
                }
                catch (Exception ex) { }
                finally { SqlCon.Close(); }
            }

            if (ds.Tables.Count > 0)
            {
                // Bind the result with the Grid
                SearchResultGrid.DataSource = ds;
                SearchResultGrid.DataBind();

                SearchResultGrid.Visible = true;
                btnExport.Visible        = true;

                lblErrorMessage.Text = "";
                TxtCourseName.Text   = "";
                TxtSkillName.Text    = "";
                DrpdwnProficiencyLevel.SelectedIndex = -1;
                TxtCourseCode.Text               = "";
                TxtCourseDescription.Text        = "";
                DrpdwnActivityType.SelectedIndex = -1;
                TxtLicenseNeeded.Text            = "";
            }
            else
            {
                SearchResultGrid.Visible = false;
                lblErrorMessage.Visible  = true;
                lblErrorMessage.Text     = "The search Term Is Not Available in the Records";;
            }
        }