protected void btnSearch_Click1(object sender, EventArgs e)
        {
            string timeStart = txtDateStart.Text != "" ? txtDateStart.Text : "none";
            string timeEnd   = txtDateEnd.Text != "" ? txtDateEnd.Text : "none";

            GV_Contact.DataSource = bus_contact.findContact(txtKeyword.Text, DropDownList1.SelectedValue, timeStart, timeEnd);
            GV_Contact.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["fullname"] == null)
            {
                Response.Redirect("/Login.aspx");
            }
            if (!HttpContext.Current.Session["role"].ToString().Equals("admin") && !HttpContext.Current.Session["role"].ToString().Equals("marketer"))
            {
                Response.Redirect("/Home.aspx");
            }

            GV_Contact.DataSource = bus_contact.getAllContact();
            GV_Contact.DataBind();
        }
예제 #3
0
        void RemplirGridView()
        {
            if (sqlCon.State == System.Data.ConnectionState.Closed)
            {
                sqlCon.Open();
            }
            SqlDataAdapter sqlDa = new SqlDataAdapter("ContactViewAll", sqlCon);

            sqlDa.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
            DataTable dtbl = new DataTable();

            sqlDa.Fill(dtbl);
            sqlCon.Close();
            GV_Contact.DataSource = dtbl;
            GV_Contact.DataBind();
        }
 protected void GV_Contact_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GV_Contact.PageIndex  = e.NewPageIndex;
     GV_Contact.DataSource = bus_contact.getAllContact();
     GV_Contact.DataBind();
 }