コード例 #1
0
    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());
    }
コード例 #2
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());
    }
コード例 #3
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());
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int NguoiChoiThu = (int)Session["NguoiChoiThu"];

        XL_THE        The       = new XL_THE("Goc");
        XL_THE        TheCon    = new XL_THE("NguoiChoiThu");
        XL_THUOC_TINH ThuocTinh = new XL_THUOC_TINH("GiaTri", NguoiChoiThu.ToString());

        TheCon.Danh_sach_thuoc_tinh.Add(ThuocTinh);
        The.Danh_sach_the.Add(TheCon);

/*
 *      TheCon = new XL_THE("XiNgau");
 *      ThuocTinh = new XL_THUOC_TINH("GiaTri", XiNgau.ToString());
 *      TheCon.Danh_sach_thuoc_tinh.Add(ThuocTinh);
 *      The.Danh_sach_the.Add(TheCon);
 */
        String Chuoi = The.Chuoi();

        XL_CHUOI.Xuat(Response, Chuoi);
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int ConCo;
        int ViTri;

        try
        {
            ConCo = int.Parse(XL_CHUOI.Nhap(Request, "ConCo"));
            ViTri = int.Parse(XL_CHUOI.Nhap(Request, "ViTri"));

            QUANLY ql = (QUANLY)Application["QUANLY"];
            Application.Lock();
            ql.BanCo.ViTriCacQuanCo[ConCo] = ViTri;
            ql.XiNgau       = -1;
            ql.DangDoXiNgau = false;
            Application.UnLock();
        }
        catch (Exception _e)
        {
        }
    }
コード例 #6
0
    protected void LayDSLoaiMonLa()   //lá
    {
        LoaiMonBUS loaimonBUS = new LoaiMonBUS();

        LoaiMonDTO[] dsLoaiMon = loaimonBUS.DanhSachLoaiMonLa();

        XL_THE Kq = new XL_THE("dsLoaiMon");

        for (int i = 0; i < dsLoaiMon.Length; ++i)
        {
            XL_THE Kq1 = new XL_THE("LoaiThe");
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("MaLoaiMon", dsLoaiMon[i].Ma_loai_mon.ToString()));
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("TenLoaiMon", dsLoaiMon[i].Ten_loai_mon));
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("MaLoaiMonCha", dsLoaiMon[i].Ma_loai_mon_cha.ToString()));
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("LaLoaiMonLa", dsLoaiMon[i].La_loai_mon_la.ToString()));

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatChuoi(Response, Kq.Chuoi());
    }
コード例 #7
0
    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());
        }
    }
コード例 #8
0
    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());
    }
コード例 #9
0
    public static TOAN_TU Nhap(String Ghi_chu)
    {
        TOAN_TU kq = TOAN_TU.Tru;
        String  Chuoi;

        do
        {
            Chuoi = XL_CHUOI.Nhap(Ghi_chu);
        } while (!Kiem_tra(Chuoi));
        char c = char.Parse(Chuoi);

        if (c == '+')
        {
            kq = TOAN_TU.Cong;
        }
        else
        if (c == '-')
        {
            kq = TOAN_TU.Tru;
        }
        return(kq);
    }
コード例 #10
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());
    }
コード例 #11
0
    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());
    }
コード例 #12
0
    public static void Main()
    {
        String   Ho_ten;
        DateTime Ngay_sinh;
        int      Tuoi;

        Ho_ten = XL_CHUOI.Nhap("Ho va ten:");
        DateTime Ngay_toi_thieu = XL_NGAY.Ngay_sinh(1, 1, 20);
        DateTime Ngay_toi_da    = XL_NGAY.Ngay_sinh(31, 12, 15);

        Ngay_sinh = XL_NGAY.Nhap("Ngay sinh:", Ngay_toi_thieu, Ngay_toi_da);
        int Nam_hien_hanh = DateTime.Today.Year;
        int Nam_sinh      = Ngay_sinh.Year;

        Tuoi = Nam_hien_hanh - Nam_sinh;
        String Chuoi;

        Chuoi = "Hoc sinh " + Ho_ten;
        Chuoi = Chuoi + " sinh ngay " + Ngay_sinh;
        Chuoi = Chuoi + " co tuoi la " + Tuoi;
        XL_CHUOI.Xuat(Chuoi);
    }
コード例 #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());
    }
コード例 #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    SoCauDaChat = (int)Application["SoCauDaChat"];
        String NoiDung;

        NoiDung = XL_CHUOI.Nhap(Request, "NoiDung");

        if (NoiDung != null)
        {
            QUANLY ql           = (QUANLY)Application["QUANLY"];
            int    nguoichoithu = int.Parse(Session["NguoiChoiThu"].ToString());
            String HoTen        = (String)ql.arrNguoiChoi[nguoichoithu].Username;
            int    SoNguoi      = ql.SoNguoiChoi + ql.SoNguoiXem;
            Application.Lock();
            ArrayList   lst = (ArrayList)Application["DanhSachNoiDung"];
            NoiDungChat nd  = new NoiDungChat(NoiDung, HoTen, SoNguoi);
            lst.Add(nd);
            SoCauDaChat++;
            Application["SoCauDaChat"] = SoCauDaChat;
            Application.UnLock();
        }
    }
コード例 #15
0
    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());
    }
コード例 #16
0
    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());
    }
コード例 #17
0
    private void LuuThamSo()
    {
        ThamSoBUS bus = new ThamSoBUS();

        ThamSoDTO dto = new ThamSoDTO();

        dto.GiaTriDiemSo           = decimal.Parse(Request["GiaTriDiemSo"].ToString());
        dto.DiemKhachHangThanThiet = int.Parse(Request["DiemKhachHangThanThiet"].ToString());
        dto.TiLeGiamGiaThucDon     = float.Parse(Request["TiLeGiamGiaThucDon"].ToString()) / 100;
        dto.Thue = float.Parse(Request["Thue"].ToString()) / 100;
        dto.GiaTriDoiDiemKhuyenMai  = decimal.Parse(Request["GiaTriDoiDiemKhuyenMai"].ToString());
        dto.GioiHanDoiDiemKhuyenMai = float.Parse(Request["GioiHanDoiDiemKhuyenMai"].ToString()) / 100;

        bool flag = bus.LuuThamSo(dto);

        XL_THE        the       = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh = new XL_THUOC_TINH("kq", flag ? "1" : "0");

        the.Danh_sach_thuoc_tinh.Add(thuoctinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #18
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());
    }
コード例 #19
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());
    }
コード例 #20
0
    private void Chi_tiet_mon_an()
    {
        int ma_mon = int.Parse(Session["MaMon"].ToString());

        //oFFS_BUS_WS.WebService service = new oFFS_BUS_WS.WebService();
        MonAnBUS monanBUS = new MonAnBUS();
        MonAnDTO MonAn    = monanBUS.ChiTietMonAn(ma_mon);

        XL_THE Kq = new XL_THE("DANH_SACH");

        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());
    }
コード例 #21
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());
    }
コード例 #22
0
    protected void ThemThucDon()
    {
        ThucDonDTO dto = new ThucDonDTO();

        dto.Ten_thuc_don      = XL_CHUOI.Nhap(Request, "ten");
        dto.Ma_loai_thuc_don  = int.Parse(XL_CHUOI.Nhap(Request, "maloai"));
        dto.Mo_ta             = XL_CHUOI.Nhap(Request, "mota");
        dto.Hinh_anh_minh_hoa = XL_CHUOI.Nhap(Request, "hinhanh");
        dto.Gia                 = decimal.Parse(XL_CHUOI.Nhap(Request, "gia"));
        dto.Tinh_trang          = bool.Parse(XL_CHUOI.Nhap(Request, "tinhtrang"));
        dto.Trang_thai_hien_thi = bool.Parse(XL_CHUOI.Nhap(Request, "hienthi"));

        String strTag       = XL_CHUOI.Nhap(Request, "tag");
        String strDsMaMonAn = XL_CHUOI.Nhap(Request, "dsmamonan");

        String[] M = strDsMaMonAn.Split(new String[] { "-" }, StringSplitOptions.RemoveEmptyEntries);

        ThucDonBUS bus = new ThucDonBUS();
        int        Kq  = bus.ThemThucDon(dto, M, strTag);

        XL_THE        the = new XL_THE("goc");
        XL_THUOC_TINH thuoc_tinh;

        if (Kq != 0)
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "true");
        }
        else
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "false");
        }

        the.Danh_sach_thuoc_tinh.Add(thuoc_tinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #23
0
    private void CapNhatThongTinMatKhau()
    {
        viewKhachHangDTO vkhDto = (viewKhachHangDTO)Session["khachhang"];

        //Lấy tham số client truyền xuống
        string mkcu  = XL_CHUOI.Nhap(Request, "mkcu");
        string mkmoi = XL_CHUOI.Nhap(Request, "mkmoi");

        XL_THE the = new XL_THE("goc");

        if (mkcu != vkhDto.Password)
        {
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("kq", "False"));
            XL_CHUOI.XuatChuoi(Response, the.Chuoi());
            return;
        }

        //Cập nhật
        int Ma_nguoi_dung = vkhDto.Ma_nguoi_dung;

        NguoiDungBUS ndBus = new NguoiDungBUS();
        bool         kq    = ndBus.CapNhatThongTinMatKhau(mkmoi, Ma_nguoi_dung);

        if (kq == true)
        {
            vkhDto.Password      = mkmoi;
            Session["khachhang"] = vkhDto;   //Lưu thông tin cho biến trong session
            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.XuatChuoi(Response, the.Chuoi());
    }
コード例 #24
0
    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());
    }
コード例 #25
0
    protected void Dat_don_hang_da_luu()
    {
        int    madonhang = int.Parse(Session["madonhangluu"].ToString());
        XL_THE the       = new XL_THE("goc");

        try
        {
            (new DonHangBUS()).CapNhatTrangThaiDaDatHang(madonhang, true);
        }
        catch (Exception ex)
        {
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("kq", "Dat hang loi"));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("flag", "false"));
            XL_CHUOI.XuatChuoi(Response, the.Chuoi());
            return;
        }

        the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("kq", "Dat hang thanh cong"));
        the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("flag", "true"));
        XL_CHUOI.XuatChuoi(Response, the.Chuoi());

        Session["madonhangluu"] = null;
        return;
    }
コード例 #26
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());
    }
コード例 #27
0
    protected void ThemMonMoi()
    {
        MonAnDTO monanDTO = new MonAnDTO();

        monanDTO.Ten_mon           = XL_CHUOI.Nhap(Request, "tenmon");
        monanDTO.Ma_loai_mon       = int.Parse(XL_CHUOI.Nhap(Request, "loaimon"));
        monanDTO.Hinh_anh_minh_hoa = XL_CHUOI.Nhap(Request, "hinhanh");
        monanDTO.Mo_ta             = XL_CHUOI.Nhap(Request, "mota");
        monanDTO.Gia         = Decimal.Parse(XL_CHUOI.Nhap(Request, "gia"));
        monanDTO.Don_vi_tinh = XL_CHUOI.Nhap(Request, "donvitinh");
        String strTag = XL_CHUOI.Nhap(Request, "tag");

        monanDTO.Diem_binh_chon      = 0;
        monanDTO.Tinh_trang          = bool.Parse(XL_CHUOI.Nhap(Request, "tinhtrang"));
        monanDTO.Trang_thai_hien_thi = bool.Parse(XL_CHUOI.Nhap(Request, "hienthi"));

        MonAnBUS monanBUS = new MonAnBUS();
        int      Kq       = monanBUS.ThemMonAn(monanDTO, strTag);

        XL_THE        the = new XL_THE("goc");
        XL_THUOC_TINH thuoc_tinh;

        if (Kq != 0)
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "true");
        }
        else
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "false");
        }

        the.Danh_sach_thuoc_tinh.Add(thuoc_tinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #28
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());
    }
コード例 #29
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());
    }
コード例 #30
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());
    }