예제 #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));
            }
        }
예제 #2
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();
 }
예제 #3
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();
            }
        }
예제 #4
0
        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();
            }
        }
예제 #5
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();
            }
        }
예제 #6
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";;
            }
        }