Example #1
0
    private void loadNguoiDungT(string noidung, string danhmuc)
    {
        int row  = 10;
        int hide = 0;

        if (Request.QueryString["p"] != null)
        {
            hide = Convert.ToInt32(Request.QueryString["p"]);
        }
        nguoidungBLL        bs = new nguoidungBLL();
        List <nguoidungDAL> ds = bs.getNguoiDungT(row, hide, noidung, danhmuc);

        rpNguoiDung.DataSource = ds;
        rpNguoiDung.DataBind();

        for (int i = 0; i <= ds.Count - 1; i++)
        {
            Label lbSTT = rpNguoiDung.Items[i].FindControl("lbSTT") as Label;
            lbSTT.Text += (i + 1 + hide).ToString();
        }
        string pa = "&tval=" + noidung + "&tkey=" + danhmuc;

        // phan trang:
        int       current = Convert.ToInt32(Request.QueryString["p"]);
        phantrang pt      = new phantrang();

        lbPage.Text = pt.paging(bs.countT(noidung, danhmuc), row, pa, current);
    }
Example #2
0
    private void loadNguoiDungV(string role)
    {
        int row  = 10;
        int hide = 0;

        if (Request.QueryString["p"] != null)
        {
            hide = Convert.ToInt32(Request.QueryString["p"]);
        }
        nguoidungBLL        bs = new nguoidungBLL();
        List <nguoidungDAL> ds = bs.getNguoiDungV(row, hide, role);

        rpNguoiDung.DataSource = ds;
        rpNguoiDung.DataBind();

        for (int i = 0; i <= ds.Count - 1; i++)
        {
            Label lbSTT = rpNguoiDung.Items[i].FindControl("lbSTT") as Label;
            lbSTT.Text += (i + 1 + hide).ToString();
        }
        // phan trang:
        int       current = Convert.ToInt32(Request.QueryString["p"]);
        phantrang pt      = new phantrang();

        lbPage.Text = pt.paging(bs.countV(ddlRole.Text), row, "", current);
    }
Example #3
0
    private void loadsp(int danhmuc, string noidung, int view)
    {
        int row  = 10;
        int hide = 0;

        if (Request.QueryString["p"] != null)
        {
            hide = Convert.ToInt32(Request.QueryString["p"]);
        }

        sanphamBLL        bs = new sanphamBLL();
        List <sanphamDAL> ds = bs.getSanPhamP(row, hide, danhmuc, noidung, view);

        rpSanpham.DataSource = ds;
        rpSanpham.DataBind();
        for (int i = 0; i <= ds.Count - 1; i++)
        {
            Label        lbSTT      = rpSanpham.Items[i].FindControl("lbSTT") as Label;
            DropDownList ddKuyenMai = rpSanpham.Items[i].FindControl("ddKuyenMai") as DropDownList;
            lbSTT.Text += (i + 1 + hide).ToString();
            if (ds[i].khuyenmai == true)
            {
                ddKuyenMai.SelectedValue = "1";
            }
            else
            {
                ddKuyenMai.SelectedValue = "0";
            }
        }
        string pa = "";

        if (view != -1)
        {
            pa = "&v=" + view + "&val=" + Request.QueryString["val"].ToString();
        }
        else if (danhmuc != -1 && noidung != "")
        {
            pa = "&t=" + danhmuc + "&n=" + noidung + "&val=" + Request.QueryString["val"].ToString();
        }
        // phan trang:
        int       current = Convert.ToInt32(Request.QueryString["p"]);
        phantrang pt      = new phantrang();

        lbPage.Text = pt.paging(bs.countP(danhmuc, noidung, view), row, pa, current);
    }
Example #4
0
    private void loadLienHe()
    {
        int row  = 10;
        int hide = 0;

        if (Request.QueryString["p"] != null)
        {
            hide = Convert.ToInt32(Request.QueryString["p"]);
        }

        lienheBLL        bs   = new lienheBLL();
        List <lienheDAL> list = bs.getLienHeP(row, hide);

        rpLienHe.DataSource = list;
        rpLienHe.DataBind();

        List <userpublicDAL> us  = (List <userpublicDAL>)Session["adminuser"];
        int              id_user = us[0].id_user;
        lienheviewBLL    b       = new lienheviewBLL();
        List <lienheDAL> ds      = b.lienhe_view(id_user);



        for (int i = 0; i <= list.Count - 1; i++)
        {
            Label lbSTT = rpLienHe.Items[i].FindControl("lbSTT") as Label;
            lbSTT.Text = (hide + i + 1).ToString();
            Label lbView = rpLienHe.Items[i].FindControl("lbview") as Label;
            if (check(list[i].id_lienhe) == true)
            {
                //  lbView.Visible = false;
                lbView.Text = "[Đã xem]";
            }
            else
            {
                lbView.Visible = true;
            }
        }

        // phan trang:
        int       current = Convert.ToInt32(Request.QueryString["p"]);
        phantrang pt      = new phantrang();

        lbPage.Text = pt.paging(bs.countP(), row, "", current);
    }
Example #5
0
    // load dat hang
    private void loadDatHang(string v)
    {
        int row  = 10;
        int hide = 0;

        if (Request.QueryString["p"] != null)
        {
            hide = Convert.ToInt32(Request.QueryString["p"]);
        }
        dathangBLL             bs      = new dathangBLL();
        phuongthucthanhtoanBLL pt_bs   = new phuongthucthanhtoanBLL();
        dathangdetailBLL       dhdt_bs = new dathangdetailBLL();
        nguoidungBLL           nd_bs   = new nguoidungBLL();
        khuyenmaiBLL           km      = new khuyenmaiBLL();
        List <dathangDAL>      ds      = bs.getDathangP(row, hide, v);

        rpDatHang.DataSource = ds;
        rpDatHang.DataBind();
        for (int i = 0; i <= ds.Count - 1; i++)
        {
            List <nguoidungDAL>           nd_ds   = nd_bs.getNguoiDungbyId(ds[i].id_user);
            List <phuongthucthanhtoanDAL> pt_ds   = pt_bs.getPhuongThucById(ds[i].id_pt);
            List <dathangdetail>          dhdt_ds = dhdt_bs.getdathangDetail(ds[i].id_dathang);
            Label lbNguoiDung = rpDatHang.Items[i].FindControl("lbNguoiDung") as Label;
            lbNguoiDung.Text = nd_ds[0].hoten;
            Label lbThanhToan = rpDatHang.Items[i].FindControl("lbThanhToan") as Label;
            lbThanhToan.Text = pt_ds[0].ten_phuongthuc;
            Label   lbTongTien = rpDatHang.Items[i].FindControl("lbTongTien") as Label;
            decimal tongTien   = 0;
            for (int j = 0; j <= dhdt_ds.Count - 1; j++)
            {
                if (dhdt_ds[j].khuyenmai == true)
                {
                    tongTien += (dhdt_ds[j].gia - (dhdt_ds[j].gia * km.getKhuyenMaibyId(1) / 100)) * dhdt_ds[j].soluong;
                }
                else
                {
                    tongTien += (dhdt_ds[j].gia * dhdt_ds[j].soluong);
                }
            }
            lbTongTien.Text = String.Format("{0:0,0 VNĐ}", tongTien);
            Label lbHinh = rpDatHang.Items[i].FindControl("lbHinh") as Label;
            if (ds[i].trangthai == true)
            {
                lbHinh.Text = "<img src=\"../images/admin/dathutien.jpg\" alt=\"Đã thu tiền\">";
            }

            Label lbSTT = rpDatHang.Items[i].FindControl("lbSTT") as Label;
            lbSTT.Text += (i + 1 + hide).ToString();
        }
        string view = "";

        if (v != "")
        {
            view = "&v=" + Request.QueryString["v"];
        }

        // phan trang:
        int       current = Convert.ToInt32(Request.QueryString["p"]);
        phantrang pt      = new phantrang();

        lbPage.Text = pt.paging(bs.countP(v), row, view, current);
    }