示例#1
0
    //This button action button for calculation of Binary tree
    protected void Action_Button_Click(object sender, EventArgs e)
    {
        cnn.Open();
        MySqlCommand cmd = cnn.CreateCommand();

        cmd.CommandType = CommandType.Text;

        //cmd.CommandText = "select *from userinfo where status='deactive'";
        cmd.CommandText = "select *from userinfo";
        cmd.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

        adp.Fill(data);
        //GridView1.DataSource = data;
        // GridView1.DataBind();

        R1.DataSource = data;
        R1.DataBind();



        cnn.Close();
    }
示例#2
0
    private void BindFiles()
    {
        DirectoryInfo di = new DirectoryInfo("C:/");

        R1.DataSource = di.GetFiles();
        R1.DataBind();
    }
示例#3
0
    protected void Update_Status(object sender, EventArgs e)
    {
        cnn.Open();
        MySqlCommand cmd = cnn.CreateCommand();

        cmd.CommandType = CommandType.Text;

        cmd.CommandText = "update userinfo set status='deactive' where username='******'";



        cmd.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

        adp.Fill(data);
        //GridView1.DataSource = data;
        // GridView1.DataBind();

        R1.DataSource = data;
        R1.DataBind();



        //  cnn.Close();
        //  ValuePass("sodipto");
    }
示例#4
0
    public void Show()
    {
        // Search.Text = rcv;

        cnn.Open();
        MySqlCommand cmd = cnn.CreateCommand();

        cmd.CommandType = CommandType.Text;

        cmd.CommandText = "SELECT * FROM payment INNER join passenger ON payment.passportNo=passenger.Passport_No WHERE passenger.Passport_No='" + Session["passport_no"] + "' ";
        //cmd.CommandText = "SELECT * FROM payment  WHERE passportNo='" + rcv + "' ";
        cmd.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

        adp.Fill(data);
        //GridView1.DataSource = data;
        // GridView1.DataBind();

        //Create the PagedDataSource that will be used in paging
        PagedDataSource pgitems = new PagedDataSource();

        pgitems.DataSource  = data.DefaultView;
        pgitems.AllowPaging = true;

        //Control page size from here
        pgitems.PageSize         = 25;
        pgitems.CurrentPageIndex = PageNumber;
        if (pgitems.PageCount > 1)
        {
            rptPaging.Visible = true;
            ArrayList pages = new ArrayList();
            for (int i = 0; i <= pgitems.PageCount - 1; i++)
            {
                pages.Add((i + 1).ToString());
            }
            rptPaging.DataSource = pages;
            rptPaging.DataBind();
        }
        else
        {
            rptPaging.Visible = false;
        }

        //Finally, set the datasource of the repeater
        // RepCourse.DataSource = pgitems;
        // RepCourse.DataBind();


        R1.DataSource = pgitems;
        R1.DataBind();


        cnn.Close();
    }
示例#5
0
    public void Show()
    {
        cnn.Open();
        MySqlCommand cmd = cnn.CreateCommand();

        cmd.CommandType = CommandType.Text;

        cmd.CommandText = "select *from userinfo ";
        cmd.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

        adp.Fill(data);
        //GridView1.DataSource = data;
        // GridView1.DataBind();

        //Create the PagedDataSource that will be used in paging
        PagedDataSource pgitems = new PagedDataSource();

        pgitems.DataSource  = data.DefaultView;
        pgitems.AllowPaging = true;

        //Control page size from here
        pgitems.PageSize         = 6;
        pgitems.CurrentPageIndex = PageNumber;
        if (pgitems.PageCount > 1)
        {
            rptPaging.Visible = true;
            ArrayList pages = new ArrayList();
            for (int i = 0; i <= pgitems.PageCount - 1; i++)
            {
                pages.Add((i + 1).ToString());
            }
            rptPaging.DataSource = pages;
            rptPaging.DataBind();
        }
        else
        {
            rptPaging.Visible = false;
        }

        //Finally, set the datasource of the repeater
        // RepCourse.DataSource = pgitems;
        // RepCourse.DataBind();


        R1.DataSource = pgitems;
        R1.DataBind();


        cnn.Close();
    }
示例#6
0
    public void Show_Search()
    {
        cnn.Open();
        MySqlCommand cmd1 = cnn.CreateCommand();

        cmd1.CommandType = CommandType.Text;

        cmd1.CommandText = "select *from userinfo where username='******'";
        cmd1.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd1);

        adp.Fill(data);
        //GridView1.DataSource = data;
        // GridView1.DataBind();

        ////Create the PagedDataSource that will be used in paging
        //PagedDataSource pgitems = new PagedDataSource();
        //pgitems.DataSource = data.DefaultView;
        //pgitems.AllowPaging = true;

        ////Control page size from here
        //pgitems.PageSize = 4;
        //pgitems.CurrentPageIndex = PageNumber;
        //if (pgitems.PageCount > 1)
        //{
        //    rptPaging.Visible = true;
        //    ArrayList pages = new ArrayList();
        //    for (int i = 0; i <= pgitems.PageCount - 1; i++)
        //    {
        //        pages.Add((i + 1).ToString());
        //    }
        //    rptPaging.DataSource = pages;
        //    rptPaging.DataBind();
        //}
        //else
        //{
        //    rptPaging.Visible = false;
        //}

        //Finally, set the datasource of the repeater
        // RepCourse.DataSource = pgitems;
        // RepCourse.DataBind();


        R1.DataSource = data;
        R1.DataBind();


        cnn.Close();
    }
示例#7
0
    public void Show_Search()
    {
        cnn.Open();
        MySqlCommand cmd1 = cnn.CreateCommand();

        cmd1.CommandType = CommandType.Text;

        cmd1.CommandText = "SELECT *FROM  passenger INNER join accountuser ON passenger.Passport_No=accountuser.passport  where  passenger.Passport_No='" + SearchTextbox.Text + "' or passenger.name='" + SearchTextbox.Text + "'  or passenger.Agent_Name='" + SearchTextbox.Text + "'  or passenger.Job_Trade='" + SearchTextbox.Text + "' or passenger.Company_Name='" + SearchTextbox.Text + "' or passenger.Sent_Work='" + SearchTextbox.Text + "' or  passenger.Travel_Date	='"+ SearchTextbox.Text + "'";
        cmd1.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd1);

        adp.Fill(data);
        //GridView1.DataSource = data;
        // GridView1.DataBind();

        ////Create the PagedDataSource that will be used in paging
        //PagedDataSource pgitems = new PagedDataSource();
        //pgitems.DataSource = data.DefaultView;
        //pgitems.AllowPaging = true;

        ////Control page size from here
        //pgitems.PageSize = 4;
        //pgitems.CurrentPageIndex = PageNumber;
        //if (pgitems.PageCount > 1)
        //{
        //    rptPaging.Visible = true;
        //    ArrayList pages = new ArrayList();
        //    for (int i = 0; i <= pgitems.PageCount - 1; i++)
        //    {
        //        pages.Add((i + 1).ToString());
        //    }
        //    rptPaging.DataSource = pages;
        //    rptPaging.DataBind();
        //}
        //else
        //{
        //    rptPaging.Visible = false;
        //}

        //Finally, set the datasource of the repeater
        // RepCourse.DataSource = pgitems;
        // RepCourse.DataBind();


        R1.DataSource = data;
        R1.DataBind();


        cnn.Close();
    }
示例#8
0
    public void Show_Search()
    {
        if (UserTable.SelectedItem.Value == "Accounter")
        {
            cnn.Open();
            MySqlCommand cmd1 = cnn.CreateCommand();
            cmd1.CommandType = CommandType.Text;

            cmd1.CommandText = "SELECT *FROM  account ";
            cmd1.ExecuteNonQuery();

            data = new DataTable();
            MySqlDataAdapter adp = new MySqlDataAdapter(cmd1);

            adp.Fill(data);


            R1.DataSource = data;
            R1.DataBind();


            cnn.Close();
        }

        else
        {
            cnn.Open();
            MySqlCommand cmd = cnn.CreateCommand();
            cmd.CommandType = CommandType.Text;

            cmd.CommandText = "SELECT *FROM dataentry ";
            cmd.ExecuteNonQuery();

            data = new DataTable();
            MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

            adp.Fill(data);


            R1.DataSource = data;
            R1.DataBind();


            cnn.Close();
        }
    }
    public void Show()
    {
        cnn.Open();
        MySqlCommand cmd = cnn.CreateCommand();

        cmd.CommandType = CommandType.Text;

        cmd.CommandText = "SELECT * FROM product ORDER BY product_ID DESC LIMIT 3";
        cmd.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

        adp.Fill(data);

        R1.DataSource = data;
        R1.DataBind();


        cnn.Close();
    }
    public void Show()
    {
        cnn.Open();
        MySqlCommand cmd = cnn.CreateCommand();

        cmd.CommandType = CommandType.Text;

        cmd.CommandText = "select * from account ";
        cmd.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

        adp.Fill(data);
        R1.DataSource = data;
        R1.DataBind();



        cnn.Close();
    }
    public void Show_Search()
    {
        cnn.Open();
        MySqlCommand cmd1 = cnn.CreateCommand();

        cmd1.CommandType = CommandType.Text;

        cmd1.CommandText = "select *from account where username='******'";
        cmd1.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd1);

        adp.Fill(data);


        R1.DataSource = data;
        R1.DataBind();


        cnn.Close();
    }
示例#12
0
    public void Show_Search()
    {
        cnn.Open();
        MySqlCommand cmd1 = cnn.CreateCommand();

        cmd1.CommandType = CommandType.Text;

        cmd1.CommandText = "SELECT *FROM  passenger INNER join accountuser ON passenger.Passport_No=accountuser.passport  where  passenger.Passport_No='" + SearchTextbox.Text + "' ";
        //cmd1.CommandText ="SELECT  *FROM passenger LEFT JOIN accountuser  ON passenger.Passport_No='" + SearchTextbox.Text + "' UNION SELECT *FROM passenger RIGHT JOIN accountuser ON passenger.Passport_No = '" + SearchTextbox.Text + "'" ;
        cmd1.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd1);

        adp.Fill(data);



        R1.DataSource = data;
        R1.DataBind();


        cnn.Close();
    }
示例#13
0
    public void Profile_Show()
    {
        cnn.Open();
        MySqlCommand cmd = cnn.CreateCommand();

        cmd.CommandType = CommandType.Text;

        cmd.CommandText = "select *from userinfo where username='******' ";
        cmd.ExecuteNonQuery();

        data = new DataTable();
        MySqlDataAdapter adp = new MySqlDataAdapter(cmd);

        adp.Fill(data);
        //GridView1.DataSource = data;
        // GridView1.DataBind();

        R1.DataSource = data;
        R1.DataBind();



        cnn.Close();
    }