Example #1
0
    protected void DS_mon_an_theo_tag()
    {
        TagMonAnBUS tagmonanBUS = new TagMonAnBUS();

        MonAnDTO[] dsMonAn = tagmonanBUS.DSMonAnTheoTag(int.Parse(Session["Tag"].ToString()));

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < dsMonAn.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("TagMonAn");

            MonAnDTO MonAn = dsMonAn[i];
            if (MonAn.Trang_thai_hien_thi == false)
            {
                continue;
            }
            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_mon", MonAn.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_mon", MonAn.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", MonAn.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Mo_ta", MonAn.Mo_ta);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Diem_binh_chon", MonAn.Diem_binh_chon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Don_vi_tinh", MonAn.Don_vi_tinh);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", MonAn.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_mon", MonAn.Ma_loai_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", MonAn.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", MonAn.Trang_thai_hien_thi.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #2
0
    private void Chi_tiet_thuc_don()
    {
        int ma_thuc_don = int.Parse(Session["MaThucDon"].ToString());

        //oFFS_BUS_WS.WebService service = new oFFS_BUS_WS.WebService();
        ThucDonBUS thucdonBUS = new ThucDonBUS();
        MonAnBUS   monanBUS   = new MonAnBUS();
        XL_THE     Kq         = new XL_THE("DANH_SACH");

        ArrayList arr = thucdonBUS.ThongTinThucDon(ma_thuc_don);

        for (int i = 0; i < arr.Count; i++)
        {
            MonAnDTO MonAn = monanBUS.ChiTietMonAn(int.Parse(arr[i].ToString()));

            XL_THE Kq1 = new XL_THE("MonAn");

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_mon", MonAn.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_mon", MonAn.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", MonAn.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Mo_ta", MonAn.Mo_ta);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Diem_binh_chon", MonAn.Diem_binh_chon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Don_vi_tinh", MonAn.Don_vi_tinh);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", MonAn.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_mon", MonAn.Ma_loai_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", MonAn.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", MonAn.Trang_thai_hien_thi.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }
        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #3
0
    private void LayDSMonAnHienThi()
    {
        int pageNum = int.Parse((string)Request["pageNum"]);

        MonAnBUS monanBUS = new MonAnBUS();

        MonAnDTO[] DsMonAn = monanBUS.LayDSMonAnHienThi(pageNum, pageSize);

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < DsMonAn.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("MonAn");

            MonAnDTO MonAn = DsMonAn[i];

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_mon", MonAn.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_mon", MonAn.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", MonAn.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Mo_ta", MonAn.Mo_ta);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Diem_binh_chon", MonAn.Diem_binh_chon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Don_vi_tinh", MonAn.Don_vi_tinh);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", MonAn.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_mon", MonAn.Ma_loai_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", MonAn.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            //Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", MonAn.Trang_thai_hien_thi.ToString());
            //Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    private void Kiem_Tra_Du_Lieu_Nhap()
    {
        String data = Request["Du_lieu_nhap"].ToString();

        String protocol = data.Substring(0, 7);

        protocol.ToLower();
        if (protocol.CompareTo("http://") != 0)
        {
            return;
        }
        if (data.IndexOf(".") < 0)
        {
            return;
        }

        XL_THE Kq = new XL_THE("Goc");

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    private void Kiem_tra_ten_quang_cao()
    {
        XmlDocument Tai_lieu  = new XmlDocument();
        XmlElement  Quang_cao = null;

        Tai_lieu.Load(Server.MapPath("QUANG_CAO.xml"));
        Quang_cao = Tai_lieu.DocumentElement;

        String  strExp1 = "//QUANG_CAO//ThongTin[@Ten='" + Request["Ten_quang_cao"] + "']";
        XmlNode _node   = Quang_cao.SelectSingleNode(strExp1);

        if (_node != null)
        {
            return;
        }

        XL_THE Kq = new XL_THE("Goc");

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #6
0
    protected void DsQuaTang()
    {
        MonAnBUS monanBUS = new MonAnBUS();
        double   limit    = double.Parse((string)Request["limit"]);

        MonAnDTO[] DsMonAn = monanBUS.LayDSQuaTang(limit);

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < DsMonAn.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("MonAn");

            MonAnDTO MonAn = DsMonAn[i];

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_mon", MonAn.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_mon", MonAn.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", MonAn.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Mo_ta", MonAn.Mo_ta);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Diem_binh_chon", MonAn.Diem_binh_chon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Don_vi_tinh", MonAn.Don_vi_tinh);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", MonAn.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_mon", MonAn.Ma_loai_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", MonAn.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", MonAn.Trang_thai_hien_thi.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["LoaiNguoiDung"] != "NhanVien" && Session["LoaiNguoiDung"] != "QuanLy")
        {
            Response.Redirect("ErrorPage.aspx");
            return;
        }
        // Xử lý request
        DonHangBUS bus = new DonHangBUS();

        XL_THE Kq = new XL_THE("DANH_SACH");

        int soLuongDonHang;

        string[] dienGiai = new string[]
        { "Đơn hàng đã đặt hàng nhưng chưa thanh toán và giao hàng",
          "Đơn hàng đã thanh toán nhưng chưa giao hàng",
          "Đơn hàng đã hoàn tất trong ngày" };
        TongDonHang[] arrFunction = new TongDonHang[]
        { bus.TongDonHangChuaThanhToanChuaGiao,
          bus.TongDonHangDaThanhToanChuaGiao, bus.TongDonHangDaHoanTatTrongNgay };

        for (int i = 1; i <= dienGiai.Length; i++)
        {
            XL_THE the = new XL_THE("BanHang");
            soLuongDonHang = arrFunction[i - 1]();

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("MaLoai", i.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("DienGiai", dienGiai[i - 1]);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("SoLuongDonHang", soLuongDonHang.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(the);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    private void Lay_danh_sach_qc_cua_website()
    {
        XmlDocument Tai_lieu1    = new XmlDocument();
        XmlElement  website      = null;
        string      arr_quangcao = "";

        Tai_lieu1.Load(Server.MapPath("WEBSITE.xml"));
        website = Tai_lieu1.DocumentElement;
        String  strExp  = "//WEBSITE//ThongTin[@Ten='" + Request["Ten_website"] + "']";
        XmlNode nodeAdv = website.SelectSingleNode(strExp);
        XL_THE  Kq      = new XL_THE("QUANG_CAO");

        if (nodeAdv != null)
        {
            foreach (XmlNode node in nodeAdv.ChildNodes)
            {
                string ten_quang_cao = node.Attributes["Ten"].Value.ToString();

                XmlDocument Tai_lieu  = new XmlDocument();
                XmlElement  Quang_cao = null;

                Tai_lieu.Load(Server.MapPath("QUANG_CAO.xml"));
                Quang_cao = Tai_lieu.DocumentElement;
                String  strExp1 = "//QUANG_CAO//ThongTin[@Ten='" + ten_quang_cao + "']";
                XmlNode _node   = Quang_cao.SelectSingleNode(strExp1);
                if (_node.Attributes["TinhTrang"].Value.ToString() == "1")
                {
                    XL_THE Kq1 = new XL_THE("ThongTin");
                    //arr_quangcao += ten_quang_cao + "-";
                    XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Logo", _node.Attributes["Logo"].Value.ToString());
                    Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
                    Thuoc_tinh = new XL_THUOC_TINH("Website", _node.Attributes["Website"].Value.ToString());
                    Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

                    Kq.Danh_sach_the.Add(Kq1);
                }
            }
        }
        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    protected void ThemThucDon()
    {
        ThucDonUaThich[] arr;
        arr = bus.LayDSThucDonYeuThich(int.Parse(Session["MaNguoiDung"].ToString()));
        if (Session["MaThucDon"] != null)
        {
            ThucDonUaThich dto = new ThucDonUaThich();
            int            ma  = int.Parse(Session["MaThucDon"].ToString());

            if (arr == null)
            {
                dto.Ma_khach_hang = int.Parse(Session["MaNguoiDung"].ToString());
                dto.Ma_thuc_don   = ma;
                bus.ThemThucDon(dto);
            }
            else
            {
                bool flag = false;
                for (int i = 0; i < arr.Length; i++)
                {
                    if (int.Parse(arr[i].Ma_thuc_don.ToString()) == ma)
                    {
                        flag = true;
                    }
                }

                if (flag == false)
                {
                    dto.Ma_khach_hang = int.Parse(Session["MaNguoiDung"].ToString());
                    dto.Ma_thuc_don   = ma;
                    bus.ThemThucDon(dto);
                }
            }

            Session["MaThucDon"] = null;

            XL_THE Kq = new XL_THE("DANH_SACH");
            XL_CHUOI.XuatXML(Response, Kq.Chuoi());
        }
    }
    private void Xoa_Quang_Cao()
    {
        XmlDocument Tai_lieu  = new XmlDocument();
        XmlElement  Quang_cao = null;

        Tai_lieu.Load(Server.MapPath("QUANG_CAO.xml"));
        Quang_cao = Tai_lieu.DocumentElement;

        foreach (XmlElement Thong_tin in Quang_cao.ChildNodes)
        {
            if (Thong_tin.GetAttribute("Ten").CompareTo(Request["Ten_cong_ty"]) == 0)
            {
                Quang_cao.RemoveChild(Thong_tin);

                //xoa trong website
                XmlDocument Tai_lieu1 = new XmlDocument();
                XmlElement  website   = null;

                Tai_lieu1.Load(Server.MapPath("WEBSITE.xml"));
                website = Tai_lieu1.DocumentElement;
                String      strExp  = "//WEBSITE//ThongTin//QuangCao[@Ten='" + Thong_tin.GetAttribute("Ten") + "']";
                XmlNodeList nodeAdv = website.SelectNodes(strExp);
                foreach (XmlNode node in nodeAdv)
                {
                    XmlNode parent = node.ParentNode;
                    parent.RemoveChild(node);
                }

                Tai_lieu1.Save(Server.MapPath("WEBSITE.xml"));

                break;
            }
        }

        Tai_lieu.Save(Server.MapPath("QUANG_CAO.xml"));
        XL_THE Kq = new XL_THE("Goc");

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #11
0
    protected void LayDSHTTT()
    {
        HinhThucThanhToanDTO[] DsHTTT = htttBus.LayDanhSachHTTT();


        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < DsHTTT.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("HinhThucThanhToan");
            HinhThucThanhToanDTO HTTT = DsHTTT[i];

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("MaHinhThucThanhToan", HTTT.Mahinh_thuc_tt.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("TenHinhThucThanhToan", HTTT.Ten_hinh_thuc_tt);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    protected void LayDSHTKM()
    {
        HinhThucKhuyenMaiDTO[] DsHTKM = htkmBus.LayDanhSachHTKM();


        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < DsHTKM.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("HinhThucKhuyenMai");
            HinhThucKhuyenMaiDTO htkm = DsHTKM[i];

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("MaHinhThucKhuyenMai", htkm.Ma_hinh_thuc_khuyen_mai.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("TenHinhThucKhuyenMai", htkm.Ten_hinh_thuc_khuyen_mai);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #13
0
    protected void XoaMonAn()
    {
        int ma = int.Parse(Request["mamon"].ToString());

        //ArrayList arr = new ArrayList();
        //arr = (ArrayList)Session["MaMonAnYeuThich"];
        //for (int i = 0; i < arr.Count; i++)
        //{
        //    if (int.Parse(arr[i].ToString()) == ma)
        //    {
        //        arr.RemoveAt(i);
        //        break;
        //    }
        //}

        //Session["MaMonAnYeuThich"] = arr;

        bus.XoaMonAnYeuDau(int.Parse(Session["MaNguoiDung"].ToString()), ma);
        XL_THE Kq = new XL_THE("DANH_SACH");

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    private void LayDSThucDon()
    {
        ThucDonYeuDauBUS tdydBus = new ThucDonYeuDauBUS();

        ThucDonUaThich[] arr = tdydBus.LayDSThucDonYeuThich(int.Parse(Session["MaNguoiDung"].ToString()));
        if (arr == null)
        {
            return;
        }

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < arr.Length; i++)
        {
            XL_THE         Kq1       = new XL_THE("ThucDon");
            ThucDonUaThich ThucDonUT = (ThucDonUaThich)arr[i];
            ThucDonDTO     thucdon   = thucdonbus.ChiTietThucDon(ThucDonUT.Ma_thuc_don);

            //ThucDonDTO thucdon = thucdonbus.ChiTietThucDon((int)arr[i]);

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_thuc_don", thucdon.Ma_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_thuc_don", thucdon.Ten_thuc_don);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", thucdon.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", thucdon.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", thucdon.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Diem_binh_chon", thucdon.Diem_binh_chon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #15
0
    private void LayDSMonAn()
    {
        MonAnYeuDauBUS maydBus = new MonAnYeuDauBUS();

        MonAnYeuDauDTO[] arr = maydBus.LayDSMonAnYeuThich(int.Parse(Session["MaNguoiDung"].ToString()));
        if (arr == null)
        {
            return;
        }

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < arr.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("MonAn");

            MonAnYeuDauDTO MonAnYeuDau = (MonAnYeuDauDTO)arr[i];
            MonAnDTO       monan       = monanbus.ChiTietMonAn(MonAnYeuDau.Ma_mon);

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_mon", monan.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_mon", monan.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", monan.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", monan.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", monan.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Diem_binh_chon", monan.Diem_binh_chon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #16
0
    private void DS_thuc_don_theo_tag()
    {
        TagThucDonBUS tagthucdonBUS = new TagThucDonBUS();

        ThucDonDTO[] dsThucDon = tagthucdonBUS.DSThucDonTheoTag(int.Parse(Session["Tag"].ToString()));

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < dsThucDon.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("ThucDon");

            ThucDonDTO ThucDon = dsThucDon[i];
            if (ThucDon.Trang_thai_hien_thi == false)
            {
                continue;
            }
            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_thuc_don", ThucDon.Ma_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_thuc_don", ThucDon.Ten_thuc_don);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", ThucDon.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", ThucDon.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_thuc_don", ThucDon.Ma_loai_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", ThucDon.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", ThucDon.Trang_thai_hien_thi.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #17
0
    private void Lay_danh_sach()
    {
        ThucDonBUS thucdonBUS = new ThucDonBUS();

        ThucDonDTO[] DsThucDon = thucdonBUS.DanhSachThucDon();

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < DsThucDon.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("ThucDon");

            ThucDonDTO ThucDon = DsThucDon[i];
            if (ThucDon.Trang_thai_hien_thi == false)
            {
                continue;
            }
            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_thuc_don", ThucDon.Ma_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_thuc_don", ThucDon.Ten_thuc_don);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", ThucDon.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", ThucDon.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_thuc_don", ThucDon.Ma_loai_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", ThucDon.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", ThucDon.Trang_thai_hien_thi.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #18
0
    public void LayDSTenMonAn()
    {
        MonAnBUS monanBUS = new MonAnBUS();

        MonAnDTO[] DsMonAn = monanBUS.DanhSachMonAn();

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < DsMonAn.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("MonAn");

            MonAnDTO MonAn = DsMonAn[i];

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("MaMon", MonAn.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("TenMon", MonAn.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #19
0
    protected void DsThucDonThuocLoaiThucDon()
    {
        ThucDonBUS thuc_donBUS = new ThucDonBUS();
        ArrayList  dsThucDon   = thuc_donBUS.LayDSThucDonThuocLoaiThucDonBatKy(int.Parse(Session["LoaiThucDon"].ToString()));

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < dsThucDon.Count; i++)
        {
            XL_THE Kq1 = new XL_THE("ThucDon");

            ThucDonDTO ThucDon = (ThucDonDTO)dsThucDon[i];
            if (ThucDon.Trang_thai_hien_thi == false)
            {
                continue;
            }
            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_thuc_don", ThucDon.Ma_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_thuc_don", ThucDon.Ten_thuc_don);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", ThucDon.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", ThucDon.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_thuc_don", ThucDon.Ma_loai_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", ThucDon.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", ThucDon.Trang_thai_hien_thi.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #20
0
    protected void Lay_danh_sach_thuc_don_tu_tao()
    {
        int makhachhang = int.Parse(Session["MaNguoiDung"].ToString());

        ThucDonBUS       thucdonbus = new ThucDonBUS();
        ThucDonCaNhanBUS thcnBus    = new ThucDonCaNhanBUS();

        ThucDonCaNhanDTO[] arr = thcnBus.LayDSThucDonYeuThich(makhachhang);

        if (arr == null)
        {
            return;
        }

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < arr.Length; i++)
        {
            XL_THE           Kq1           = new XL_THE("ThucDon");
            ThucDonCaNhanDTO ThucDonCaNhan = (ThucDonCaNhanDTO)arr[i];
            //ThucDonDTO thucdon = thucdonbus.ChiTietThucDon(ThucDonCaNhan.Ma_thuc_don_ca_nhan);

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_thuc_don", ThucDonCaNhan.Ma_thuc_don_ca_nhan.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_thuc_don", ThucDonCaNhan.Ten_thuc_don);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", ThucDonCaNhan.Hinh_anh);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", ThucDonCaNhan.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #21
0
    public void LayDSTenThucDon()
    {
        ThucDonBUS bus = new ThucDonBUS();

        ThucDonDTO[] DsThucDon = bus.DanhSachThucDon();

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < DsThucDon.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("ThucDon");

            ThucDonDTO dto = DsThucDon[i];

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("MaThucDon", dto.Ma_thuc_don.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("TenThucDon", dto.Ten_thuc_don);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #22
0
    private void LayDanhSachNguoiDung()
    {
        // Xử lý request
        NguoiDungBUS bus             = new NguoiDungBUS();
        int          tongSoNguoiDung = bus.TongSoNguoiDung();
        int          pageSize        = tongSoNguoiDung;
        int          pageNum         = 1;

        NguoiDungDTO[] kq = bus.LayDanhSachNguoiDung(pageNum, pageSize);

        XL_THE ds = new XL_THE("DANH_SACH");

        foreach (NguoiDungDTO dto in kq)
        {
            XL_THE the = new XL_THE("TaiKhoan");

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Username", dto.Username);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            ds.Danh_sach_the.Add(the);
        }

        XL_CHUOI.XuatXML(Response, ds.Chuoi());
    }
    protected void LayDanhSach()
    {
        TagDTO[] ds = tag.LayDanhSachTag();

        XL_THE Kq = new XL_THE("DANH_SACH");

        for (int i = 0; i < ds.Length; i++)
        {
            XL_THE Kq1 = new XL_THE("Tag");

            TagDTO dto = ds[i];

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_tag", dto.Ma_tag.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_tag", dto.Ten_tag);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Do_uu_tien", dto.Do_uu_tien.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    public void XacNhanCode()
    {
        String strCode = Request["code"];

        bool Kq = false;

        if (strCode == Session["CaptchaImageText"].ToString())
        {
            Kq = true;
        }

        XL_THE the = new XL_THE("goc");

        if (Kq == true)
        {
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("kq", "true"));
        }
        else
        {
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("kq", "false"));
        }

        XL_CHUOI.XuatXML(Response, the.Chuoi());
    }
Example #25
0
    private void LayCTDonHang()
    {
        int maDonHang = int.Parse(Request["MaDonHang"]);

        XL_THE kq = new XL_THE("DanhSachCTDonHang");

        CTDonHangBUS ctdhbus = new CTDonHangBUS();

        CTDonHangDTO[] arrCtdhDto = ctdhbus.DanhSachCTDonHang(maDonHang);
        foreach (CTDonHangDTO ctdh in arrCtdhDto)
        {
            XL_THE the = new XL_THE("CTDonHang");

            // mã chi tiết đơn hàng
            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("MaCTDonHang", ctdh.Ma_ct_don_hang.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);


            string loai = "";
            string ten  = "";
            switch (ctdh.Loai_item)
            {
            case 0:     // món ăn
                loai = "Món ăn";
                MonAnBUS maBus = new MonAnBUS();
                MonAnDTO ma    = maBus.ChiTietMonAn(ctdh.Ma_item);

                if (ma != null)
                {
                    ten = ma.Ten_mon;
                }
                else
                {
                    ten = "Món ăn này không tồn tại";
                }
                break;

            case 1:     // thực đơn
                loai = "Thực đơn";
                ThucDonBUS tdBus = new ThucDonBUS();
                ThucDonDTO tdDto = tdBus.ChiTietThucDon(ctdh.Ma_item);
                if (tdDto != null)
                {
                    ten = tdDto.Ten_thuc_don;
                }
                else
                {
                    ten = "Thực đơn này không tồn tại";
                }
                break;

            case 2:     // thực đơn cá nhân
                loai = "Thực đơn cá nhân";
                ThucDonCaNhanBUS tdcnBus = new ThucDonCaNhanBUS();
                ThucDonCaNhanDTO tdcnDto = tdcnBus.ChiTietThucDonCaNhan(ctdh.Ma_item);
                if (tdcnDto != null)
                {
                    ten = tdcnDto.Ten_thuc_don;
                }
                else
                {
                    ten = "Thực đơn cá nhân này không tồn tại";
                }
                break;
            }

            // Tên món hoặc tên thực đơn
            Thuoc_tinh = new XL_THUOC_TINH("Ten", ten);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            // Loại đơn hàng
            Thuoc_tinh = new XL_THUOC_TINH("LoaiItem", loai);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            // Số lượng
            Thuoc_tinh = new XL_THUOC_TINH("SoLuong", ctdh.So_luong.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            // Thành tiền
            Thuoc_tinh = new XL_THUOC_TINH("ThanhTien", ctdh.Thanh_tien.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            kq.Danh_sach_the.Add(the);
        }

        XL_CHUOI.XuatXML(Response, kq.Chuoi());
    }
Example #26
0
    private void LayThongTinDonHang()
    {
        DonHangBUS bus = new DonHangBUS();

        int maDonHang = int.Parse(Request["MaDonHang"]);

        DonHangDTO dhDTO = bus.LayThongTinDonHang(maDonHang);

        XL_THE kq = new XL_THE("DonHang");

        NguoiDungBUS ndBUS = new NguoiDungBUS();
        NguoiDungDTO ndDTO = ndBUS.ThongTinNguoiDung(dhDTO.Ma_khach_hang);

        XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("TenKhachHang", ndDTO.Ho_ten);

        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        Thuoc_tinh = new XL_THUOC_TINH("NgayGioLap", dhDTO.Ngay_gio_lap.ToString());
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        Thuoc_tinh = new XL_THUOC_TINH("DiaChiNhan", dhDTO.Dia_chi_nhan.ToString());
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        Thuoc_tinh = new XL_THUOC_TINH("NguoiNhan", dhDTO.Nguoi_nhan);
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        string tinhTrang = "";

        // Đã đặt hàng nhưng chưa thanh toán
        if (dhDTO.Da_dat_hang == true && dhDTO.Da_thanh_toan == false && dhDTO.Da_giao_hang == false)
        {
            tinhTrang = "0";
        }
        // Đã thanh toán nhưng chưa giao hàng
        else if (dhDTO.Da_dat_hang == true && dhDTO.Da_thanh_toan == true && dhDTO.Da_giao_hang == false)
        {
            tinhTrang = "1";
        }
        // Đã hoàn tất
        else if (dhDTO.Da_dat_hang == true && dhDTO.Da_thanh_toan == true && dhDTO.Da_giao_hang == true)
        {
            tinhTrang = "2";
        }

        Thuoc_tinh = new XL_THUOC_TINH("NgayGioGiaoHang", tinhTrang == "2" ? dhDTO.Ngay_gio_giao_hang.ToString() : "chưa");
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        HinhThucKhuyenMaiBUS htkmBus = new HinhThucKhuyenMaiBUS();
        HinhThucKhuyenMaiDTO htkmDto = htkmBus.ThongTinHTKM(dhDTO.Hinh_thuc_khuyen_mai);
        string tenHinhThucKhuyenMai  = "Không có";

        if (htkmDto != null)
        {
            tenHinhThucKhuyenMai = htkmDto.Ten_hinh_thuc_khuyen_mai;
        }
        Thuoc_tinh = new XL_THUOC_TINH("HinhThucKhuyenMai", tenHinhThucKhuyenMai);
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        Thuoc_tinh = new XL_THUOC_TINH("TienKhuyenMai", dhDTO.Tien_khuyen_mai.ToString());
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        Thuoc_tinh = new XL_THUOC_TINH("GiaTri", dhDTO.Gia_tri.ToString());
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        Thuoc_tinh = new XL_THUOC_TINH("TienThue", dhDTO.Tien_thue.ToString());
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        Thuoc_tinh = new XL_THUOC_TINH("TinhTrang", tinhTrang);
        kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        XL_CHUOI.XuatXML(Response, kq.Chuoi());
    }
    void LayDanhSachThucDon()
    {
        // Xử lý request
        int pageSize = 10;

        if (Request["results"] != null)
        {
            pageSize = int.Parse((string)Request["results"]);
        }

        int pageNum = 1;

        if (Request["startIndex"] != null)
        {
            pageNum = (int.Parse((string)Request["startIndex"]) / pageSize) + 1;
        }

        ThucDonBUS bus = new ThucDonBUS();

        ThucDonDTO[] kq = bus.DanhSachThucDon(pageNum, pageSize);

        LoaiThucDonBUS ltdBus = new LoaiThucDonBUS();

        int tongSoThucDon = bus.TongSoThucDon();

        XL_THE        Kq         = new XL_THE("DANH_SACH");
        XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("totalRecords", tongSoThucDon.ToString());

        Kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        foreach (ThucDonDTO dto in kq)
        {
            XL_THE the = new XL_THE("ThucDon");

            Thuoc_tinh = new XL_THUOC_TINH("MaThucDon", dto.Ma_thuc_don.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("TenThucDon", dto.Ten_thuc_don);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            LoaiThucDonDTO ltdDto = ltdBus.ChiTietLoaiThucDon(dto.Ma_loai_thuc_don);
            Thuoc_tinh = new XL_THUOC_TINH("LoaiThucDon", ltdDto.Ten_loai_thuc_don);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("MoTa", dto.Mo_ta);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("HinhAnhMinhHoa", dto.Hinh_anh_minh_hoa);
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("Gia", dto.Gia.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("TrangThaiHienThi", dto.Trang_thai_hien_thi ? "1" : "0");
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("TinhTrang", dto.Tinh_trang ? "1" : "0");
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(the);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
    protected void DuyetCayLoaiMon()
    {
        // Xử lý request
        int pageSize = 10;

        if (Request["results"] != null)
        {
            pageSize = int.Parse((string)Request["results"]);
        }

        int pageNum    = 1;
        int startIndex = 0;

        if (Request["startIndex"] != null)
        {
            startIndex = int.Parse((string)Request["startIndex"]);
            pageNum    = (startIndex / pageSize) + 1;
        }

        //Duyệt cây loại món
        ArrayList ds = new ArrayList();

        LoadLoaiMonDeQui(-1, 0, ds);

        XL_THE        Kq         = new XL_THE("DANH_SACH");
        XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("totalRecords", ds.Count.ToString());

        Kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

        int n = startIndex + pageSize;

        n = (n < ds.Count) ? n : ds.Count;

        for (int i = startIndex; i < n; i++)
        {
            LoaiMonItem lmItem = (LoaiMonItem)ds[i];

            XL_THE the = new XL_THE("Record");

            Thuoc_tinh = new XL_THUOC_TINH("MaLoaiMon", lmItem.MaLoaiMon.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("TenLoaiMon", lmItem.TenLoaiMon.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("LaLoaiMonLa", lmItem.LaLoaiMonLa.ToString());
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            if (lmItem.LaLoaiMonLa == true)
            {
                Thuoc_tinh = new XL_THUOC_TINH("SoLuongMonCon", lmItem.SoLuongMonCon.ToString());
            }
            else
            {
                Thuoc_tinh = new XL_THUOC_TINH("SoLuongMonCon", "-");
            }
            the.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(the);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #29
0
    protected void DsMonAnThuocLoaiMon()
    {
        // Xử lý request
        int pageSize = 5;

        if (Request["results"] != null)
        {
            pageSize = int.Parse((string)Request["results"]);
        }

        int pageNum    = 1;
        int startIndex = 0;

        if (Request["startIndex"] != null)
        {
            startIndex = int.Parse((string)Request["startIndex"]);
            pageNum    = (startIndex / pageSize) + 1;
        }

        MonAnBUS  mon_anBUS = new MonAnBUS();
        ArrayList dsMonAn   = new ArrayList();
        int       index     = 0;
        int       loaimon   = -1;

        if (Session["LoaiNguoiDung"] == "NhanVien" || Session["LoaiNguoiDung"] == "QuanLy")
        {
            loaimon = int.Parse((string)Request["LoaiMon"]);
        }
        else
        {
            loaimon = int.Parse(Session["LoaiMon"].ToString());
        }

        dsMonAn = mon_anBUS.LayDSMonAnThuocLoaiMonBatKy(loaimon);
        int n = dsMonAn.Count;

        XL_THE Kq = new XL_THE("DANH_SACH");

        if (Session["LoaiNguoiDung"] == "NhanVien" || Session["LoaiNguoiDung"] == "QuanLy") //co phan trang
        {
            index = startIndex;
            n     = startIndex + pageSize;
            n     = (n < dsMonAn.Count) ? n : dsMonAn.Count;

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("totalRecords", dsMonAn.Count.ToString());
            Kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
        }

        LoaiMonDTO lmDto = (new LoaiMonBUS()).ChiTietLoaiMon(loaimon);   //chu íu lấy tên loại món

        for (int i = index; i < n; i++)
        {
            XL_THE Kq1 = new XL_THE("MonAn");

            MonAnDTO MonAn = (MonAnDTO)dsMonAn[i];
//             if (MonAn.Trang_thai_hien_thi == false)
//                 continue;
            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("MaMonAn", MonAn.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("TenMonAn", MonAn.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("LoaiMonAn", lmDto.Ten_loai_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("MoTa", MonAn.Mo_ta);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("HinhAnhMinhHoa", MonAn.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("Gia", MonAn.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("TrangThaiHienThi", MonAn.Trang_thai_hien_thi ? "1" : "0");
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Thuoc_tinh = new XL_THUOC_TINH("TinhTrang", MonAn.Tinh_trang ? "1": "0");
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }
Example #30
0
    protected void DsMonAnThuocLoaiMonBatKy()
    {
        int pageSize = 5;

        if (Request["results"] != null)
        {
            pageSize = int.Parse((string)Request["results"]);
        }

        int pageNum    = 1;
        int startIndex = 0;

        if (Request["startIndex"] != null)
        {
            startIndex = int.Parse((string)Request["startIndex"]);
            pageNum    = (startIndex / pageSize) + 1;
        }

        MonAnBUS  mon_anBUS = new MonAnBUS();
        ArrayList dsMonAn   = new ArrayList();
        int       index     = 0;
        int       loaimon   = -1;

        if (Session["LoaiNguoiDung"].ToString() == "NhanVien")
        {
            loaimon = int.Parse((string)Request["LoaiMon"]);
        }
        else
        {
            loaimon = int.Parse(Session["LoaiMon"].ToString());
        }
        dsMonAn = mon_anBUS.LayDSMonAnThuocLoaiMonBatKy(loaimon);
        int n = dsMonAn.Count;

        XL_THE Kq = new XL_THE("DANH_SACH");

        if (Session["LoaiNguoiDung"].ToString() == "NhanVien") //co phan trang
        {
            index = startIndex;
            n     = startIndex + pageSize;
            n     = (n < dsMonAn.Count) ? n : dsMonAn.Count;

            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("totalRecords", dsMonAn.Count.ToString());
            Kq.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
        }



        for (int i = index; i < n; i++)
        {
            XL_THE Kq1 = new XL_THE("MonAn");

            MonAnDTO MonAn = (MonAnDTO)dsMonAn[i];
            if (MonAn.Trang_thai_hien_thi == false)
            {
                continue;
            }
            XL_THUOC_TINH Thuoc_tinh = new XL_THUOC_TINH("Ma_mon", MonAn.Ma_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ten_mon", MonAn.Ten_mon);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Hinh_anh_minh_hoa", MonAn.Hinh_anh_minh_hoa);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Mo_ta", MonAn.Mo_ta);
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Diem_binh_chon", MonAn.Diem_binh_chon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Don_vi_tinh", MonAn.Don_vi_tinh);

            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Gia", MonAn.Gia.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Ma_loai_mon", MonAn.Ma_loai_mon.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Tinh_trang", MonAn.Tinh_trang.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);
            Thuoc_tinh = new XL_THUOC_TINH("Trang_thai_hien_thi", MonAn.Trang_thai_hien_thi.ToString());
            Kq1.Danh_sach_thuoc_tinh.Add(Thuoc_tinh);

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatXML(Response, Kq.Chuoi());
    }