コード例 #1
0
    void CapNhatTrangThai()
    {
        string strMaDonHang = (string)Request["MaDonHang"];
        int    trangThai    = int.Parse(Request["TrangThai"]);
        int    maDonHang    = int.Parse(strMaDonHang);

        DonHangBUS bus  = new DonHangBUS();
        bool       flag = false;

        DateTime now = DateTime.Now;

        if (trangThai == 0) // Cập nhật đã thanh toán
        {
            flag = bus.CapNhatTrangThaiDaThanhToan(maDonHang, true);
        }
        else if (trangThai == 1) // Cập nhật đã giao hàng (hoàn tất)
        {
            flag = bus.CapNhatTrangThaiDaThanhToan(maDonHang, true) && bus.CapNhatTrangThaiDaGiaoHang(maDonHang, true) &&
                   bus.CapNhatNgayGioGiaoHang(maDonHang, now);
        }

        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);
        thuoctinh = new XL_THUOC_TINH("NgayGioGiaoHang", now.ToString());
        the.Danh_sach_thuoc_tinh.Add(thuoctinh);

        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #2
0
    protected void KiemTraTheTonTai()
    {
        string tenloaithe = XL_CHUOI.Nhap(Request, "tenloaithe").ToString();

        string   sothe      = XL_CHUOI.Nhap(Request, "sothe");
        DateTime ngayhethan = DateTime.Parse(XL_CHUOI.Nhap(Request, "ngayhethan").ToString());

        WS_CardSystem.CardDTO cardDto = new WS_CardSystem.CardDTO();
        cardDto.Code         = sothe;
        cardDto.Expried_date = ngayhethan;
        cardDto.Type         = tenloaithe;

        WS_CardSystem.Service ws = new WS_CardSystem.Service();

        XL_THE Kq = new XL_THE("goc");
        bool   kt = ws.KiemTraHopLe(cardDto);

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

        XL_CHUOI.XuatChuoi(Response, Kq.Chuoi());
    }
コード例 #3
0
    private void GuiLaiMatKhau()
    {
        string Username = (string)Request["Username"];

        byte[] arr = new byte[10];
        Random r   = new Random((int)DateTime.Now.ToBinary());

        r.NextBytes(arr);
        string pass = Utilities.ConvertToHexa(arr);

        NguoiDungBUS ndBus       = new NguoiDungBUS();
        NguoiDungDTO dto         = ndBus.LayThongTinNguoiDung(Username);
        int          maNguoiDung = dto.Ma_nguoi_dung;
        bool         flag        = Utilities.SendMail("*****@*****.**", dto.Email, "(OFFS) Reset mật khẩu", "Mật khẩu mới: <strong>" + pass + "</strong>") == "";
        string       passSHA1    = Utilities.SHA1(pass).ToLower();
        bool         kq          = ndBus.CapNhatThongTinMatKhau(passSHA1, maNguoiDung);

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

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #4
0
    protected void XoaLoaiMon()
    {
        //Lấy tham số client truyền xuống
        int maloaimon = int.Parse(XL_CHUOI.Nhap(Request, "maloaimon"));

        //Xóa loại món
        LoaiMonBUS khBus = new LoaiMonBUS();
        bool       kq    = new LoaiMonBUS().XoaLoaiMon(maloaimon);


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

        //Them thanh cong
        if (kq == true)
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "1");
        }
        else
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "0");
        }

        //Trả kết quả về client
        the.Danh_sach_thuoc_tinh.Add(thuoc_tinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #5
0
    protected void Lay_trang_thai_form()
    {
        if (Session["FormDatHang"] != null)
        {
            FormDatHang form = (FormDatHang)Session["FormDatHang"];
            XL_THE      the  = new XL_THE("Goc");

            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbDiemSD", form.cmbDiemSD.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("lbSoTien", form.lbSoTien));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbHTKM", form.cmbHTKM.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbHTTT", form.cmbHTTT.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("rdThe", form.rdThe));
            if (form.rdThe == "rdKhac")
            {
                the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("nodeLoaiThe", form.nodeLoaiThe.ToString()));
                the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("nodeSoThe", form.nodeSoThe));
                the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("nodeNgayHH", form.nodeNgayHH.ToString()));
                the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("nodeThangHH", form.nodeThangHH.ToString()));
                the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("nodeNamHH", form.nodeNamHH.ToString()));
            }
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("txtNguoiNhan", form.txtNguoiNhan));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("txtDiaChiNhan", form.txtDiaChiNhan));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbNgayGH", form.cmbNgayGH.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbThangGH", form.cmbThangGH.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbNamGH", form.cmbNamGH.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbGioGH", form.cmbGioGH.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbPhutGH", form.cmbPhutGH.ToString()));
            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("cmbBuoiGH", form.cmbBuoiGH.ToString()));

            string chuoi = the.Chuoi();
            XL_CHUOI.XuatChuoi(Response, chuoi);
        }
    }
コード例 #6
0
    protected void ThemLoaiMonMoi()
    {
        LoaiMonDTO lmDto = new LoaiMonDTO();

        //Lấy tham số client truyền xuống
        lmDto.Ten_loai_mon    = XL_CHUOI.Nhap(Request, "tenloaimon");
        lmDto.Ma_loai_mon_cha = int.Parse(XL_CHUOI.Nhap(Request, "maloaimoncha"));
        lmDto.La_loai_mon_la  = bool.Parse(XL_CHUOI.Nhap(Request, "laloaimonla"));

        //Thêm loại món mới
        LoaiMonBUS khBus = new LoaiMonBUS();
        bool       kq    = new LoaiMonBUS().ThemLoaiMon(lmDto);


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

        //Them thanh cong
        if (kq == true)
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "True");
        }
        else
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "False");
        }

        //Trả kết quả về client
        the.Danh_sach_thuoc_tinh.Add(thuoc_tinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #7
0
    protected void LayTiLeGiamGiaThucDon()
    {
        ThamSoBUS bus = new ThamSoBUS();
        ThamSoDTO dto = bus.LayThamSo();

        XL_THE Kq = new XL_THE("THAM_SO");

        Kq.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("TiLeGiam", dto.TiLeGiamGiaThucDon.ToString()));

        XL_CHUOI.XuatChuoi(Response, Kq.Chuoi());
    }
コード例 #8
0
    protected void ThemThucDonTuTao()
    {
        //if(Session["User"] == null)
        //    return; //không đc dùng chức năng

        //test : gán
        //Session["User"] = "******";


        String Username = Session["User"].ToString();

        ThucDonCaNhanDTO dto = new ThucDonCaNhanDTO();

        dto.Ten_thuc_don = XL_CHUOI.Nhap(Request, "ten");
        dto.Gia          = decimal.Parse(XL_CHUOI.Nhap(Request, "gia"));
        dto.Hinh_anh     = XL_CHUOI.Nhap(Request, "hinh_anh");

        //lấy mã khách hàng
        if (Session["khachhang"] != null) //đã có thông tin trong session khách hàng
        {
            dto.Ma_khach_hang = ((viewKhachHangDTO)Session["khachhang"]).Ma_nguoi_dung;
        }
        else
        {       //chưa có thông tin -> đọc thông tin về kh từ username
            KhachHangBUS     khBus  = new KhachHangBUS();
            viewKhachHangDTO viewKH = khBus.LayThongTinKhachHang(Username);
            dto.Ma_khach_hang = viewKH.Ma_nguoi_dung;
        }


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

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

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

        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);
    }
コード例 #9
0
    protected void ThemKhachHang()
    {
        KhachHangDTO khachhangdto = new KhachHangDTO();

        khachhangdto.Ho_ten   = XL_CHUOI.Nhap(Request, "hoten");
        khachhangdto.Username = XL_CHUOI.Nhap(Request, "username");

        khachhangdto.Password = XL_CHUOI.Nhap(Request, "password"); //hex string

        khachhangdto.Email      = XL_CHUOI.Nhap(Request, "email");
        khachhangdto.Dia_chi    = XL_CHUOI.Nhap(Request, "diachi");
        khachhangdto.Dien_thoai = XL_CHUOI.Nhap(Request, "dienthoai");
        khachhangdto.Gioi_tinh  = bool.Parse(XL_CHUOI.Nhap(Request, "gioitinh"));
        khachhangdto.Ngay_sinh  = DateTime.Parse(XL_CHUOI.Nhap(Request, "date").ToString());

        TheThanhToanDTO thedto = new TheThanhToanDTO();

        thedto.Ma_loai_the  = int.Parse(XL_CHUOI.Nhap(Request, "loaithe").ToString());
        thedto.So_the       = XL_CHUOI.Nhap(Request, "mathe");
        thedto.Ngay_het_han = DateTime.Parse(XL_CHUOI.Nhap(Request, "dateHH").ToString());

        int           manguoidung = 0;
        XL_THE        the         = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh   = new XL_THUOC_TINH("Kq", "false");

        try
        {
            KhachHangBUS khachhangBUS = new KhachHangBUS();
            manguoidung = khachhangBUS.ThemKhachHang(khachhangdto, thedto);

            if (manguoidung != 0)
            {
                thuoctinh = new XL_THUOC_TINH("kq", "true");
            }
            else
            {
                thuoctinh = new XL_THUOC_TINH("kq", "error");
            }
        }
        catch (SqlException ex)
        {
            if (ex.Number == 2627)
            {
                thuoctinh = new XL_THUOC_TINH("kq", "false");
            }
        }

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #10
0
    protected void Tinh_tien_khuyen_mai()
    {
        int     diem = int.Parse(Request["DiemKhuyenMai"].ToString());
        decimal tien = (new DonHangBUS()).TinhTienKhuyenMai(diem);

        XL_THE        the       = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh = new XL_THUOC_TINH("Kq", tien.ToString());

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #11
0
    protected void Tinh_tien_thue()
    {
        Gio_hang_online gio_hang  = (Gio_hang_online)Session["Gio_hang"];
        decimal         giatri    = gio_hang.gia_tri;
        decimal         a         = (new DonHangBUS()).TinhTienThue(giatri);
        double          tienthue  = double.Parse(a.ToString());
        XL_THE          the       = new XL_THE("goc");
        XL_THUOC_TINH   thuoctinh = new XL_THUOC_TINH("Kq", tienthue.ToString());

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

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

        TheThanhToanDTO tttDto = new TheThanhToanDTO();

        tttDto.Ma_the = vkhDto.Ma_the;

        //Lấy tham số client truyền xuống
        tttDto.Ma_loai_the = int.Parse(XL_CHUOI.Nhap(Request, "maloaithe"));
        //tttDto.So_the = XL_CHUOI.Nhap(Request, "sothe").ToCharArray();
        tttDto.So_the       = XL_CHUOI.Nhap(Request, "sothe").ToString();
        tttDto.Ngay_het_han = DateTime.Parse(Request["ngayhh"].ToString());

        //Cập nhật neu co thay doi
        bool kq = true;

        if (tttDto.Ma_loai_the != vkhDto.Ma_loai_the || tttDto.So_the != vkhDto.So_the || tttDto.Ngay_het_han != vkhDto.Ngay_het_han)
        {
            kq = (new TheThanhToanBUS()).CapNhatTheThanhToan(tttDto);
        }

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

        if (kq == true)
        {
            //Lưu lại biến trong session
            vkhDto.Ma_loai_the = tttDto.Ma_loai_the;
            //vkhDto.Ten_loai_the = (new LoaiTheBUS()).Lay_Ten_Loai_The(tttDto.Ma_loai_the);
            vkhDto.Ten_loai_the = Request["tenloaithe"].ToString();
            vkhDto.So_the       = tttDto.So_the;
            vkhDto.Ngay_het_han = tttDto.Ngay_het_han;

            Session["khachhang"] = vkhDto;

            thuoc_tinh = new XL_THUOC_TINH("kq", "True");
        }
        else
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "False");
        }

        //Trả kết quả về client
        the.Danh_sach_thuoc_tinh.Add(thuoc_tinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #13
0
    protected void Tinh_so_diem_hoan_lai()
    {
        decimal tiendu = int.Parse(Request["tiendu"].ToString());

        int diemhoanlai = (new DonHangBUS()).TinhDiemHoanLai(tiendu);

        if (diemhoanlai != 0)
        {
            XL_THE the = new XL_THE("goc");

            the.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("Kq", diemhoanlai.ToString()));
            string chuoi = the.Chuoi();
            XL_CHUOI.XuatChuoi(Response, chuoi);
        }
    }
コード例 #14
0
    protected void Lay_ma_thuc_don()
    {
        XL_THE Kq = new XL_THE("DANH_SACH");

        if (Session["MaThucDon"] == null)
        {
            Kq.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("Ma_thuc_don", "-1"));
        }
        else
        {
            Kq.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("Ma_thuc_don", Session["MaThucDon"].ToString()));
        }

        Session["MaThucDon"] = null;
        XL_CHUOI.XuatChuoi(Response, Kq.Chuoi());
    }
コード例 #15
0
    private void XoaThucDon()
    {
        string strMaThucDon = (string)Request["MaThucDon"];

        int        maThucDon = int.Parse(strMaThucDon);
        ThucDonBUS bus       = new ThucDonBUS();
        bool       flag      = bus.XoaThucDon(maThucDon);

        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);
    }
コード例 #16
0
    private void XoaTaiKhoan()
    {
        string strMaNguoiDung = (string)Request["MaNguoiDung"];

        int          maNguoiDung = int.Parse(strMaNguoiDung);
        NguoiDungBUS bus         = new NguoiDungBUS();
        bool         flag        = bus.XoaNguoiDung(maNguoiDung);

        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);
    }
コード例 #17
0
    void CapNhat(CapNhatBUS cn)
    {
        string strMaThucDon = (string)Request["MaThucDon"];
        bool   giaTri       = int.Parse(Request["GiaTri"]) == 1;
        int    maThucDon    = int.Parse(strMaThucDon);

        bool flag = cn(giaTri, maThucDon);

        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 LayNoiDungEmail()
    {
        string strMaMail = (string)Request["MaMail"];

        int             maMail    = int.Parse(strMaMail);
        NoiDungEmailBUS bus       = new NoiDungEmailBUS();
        NoiDungEmailDTO dto       = bus.LayNoiDungEmail(maMail);
        string          str       = HttpUtility.HtmlEncode(dto.NoiDung);
        XL_THE          the       = new XL_THE("goc");
        XL_THUOC_TINH   thuoctinh = new XL_THUOC_TINH("kq", str);

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #19
0
    protected void Tinh_so_diem_toi_da()
    {
        decimal          giatri = int.Parse(Request["GiaTri"].ToString());
        viewKhachHangDTO vkhDto = (viewKhachHangDTO)Session["khachhang"];
        int diemht = vkhDto.Diem_khuyen_mai;

        int diem = (new DonHangBUS()).TinhSoDiemToiDa(giatri, diemht);

        XL_THE        the       = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh = new XL_THUOC_TINH("Kq", diem.ToString());

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #20
0
    void CapNhatTinhTrangKichHoat()
    {
        string strMaNguoiDung    = (string)Request["MaNguoiDung"];
        bool   tinhTrangKichHoat = int.Parse(Request["TinhTrang"]) == 1;
        int    maNguoiDung       = int.Parse(strMaNguoiDung);

        NguoiDungBUS bus  = new NguoiDungBUS();
        bool         flag = bus.CapNhatTinhTrangKichHoat(tinhTrangKichHoat, maNguoiDung);

        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);
    }
コード例 #21
0
    public void TaoTaiKhoan()
    {
        NguoiDungDTO nguoidung = new NguoiDungDTO();

        nguoidung.Ma_loai_nguoi_dung = int.Parse(XL_CHUOI.Nhap(Request, "loai"));
        nguoidung.Ho_ten             = XL_CHUOI.Nhap(Request, "hoten");
        nguoidung.Username           = XL_CHUOI.Nhap(Request, "username");
        nguoidung.Password           = XL_CHUOI.Nhap(Request, "password");

        nguoidung.Email                = XL_CHUOI.Nhap(Request, "email");
        nguoidung.Dia_chi              = XL_CHUOI.Nhap(Request, "diachi");
        nguoidung.Dien_thoai           = XL_CHUOI.Nhap(Request, "dienthoai");
        nguoidung.Gioi_tinh            = bool.Parse(XL_CHUOI.Nhap(Request, "gioitinh"));
        nguoidung.Ngay_sinh            = DateTime.Parse(XL_CHUOI.Nhap(Request, "date").ToString());
        nguoidung.Tinh_trang_kich_hoat = bool.Parse(XL_CHUOI.Nhap(Request, "kichhoat"));

        int           manguoidung = 0;
        XL_THE        the         = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh;

        try
        {
            //oFFS_BUS_WS.WebService service = new oFFS_BUS_WS.WebService();
            NguoiDungBUS nguoidungBUS = new NguoiDungBUS();
            manguoidung = nguoidungBUS.ThemNguoiDung(nguoidung);

            if (manguoidung != 0)
            {
                thuoctinh = new XL_THUOC_TINH("kq", "true");
            }
            else
            {
                thuoctinh = new XL_THUOC_TINH("kq", "false");
            }
        }
        catch
        {
            thuoctinh = new XL_THUOC_TINH("kq", "false");
        }

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #22
0
    protected void LayDSLoaiMonGoc() //gốc
    {
        LoaiMonBUS loaimonBUS = new LoaiMonBUS();

        LoaiMonDTO[] dsLoaiMon = loaimonBUS.LayDanhSachLoaiMonGoc();

        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));
            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatChuoi(Response, Kq.Chuoi());
    }
コード例 #23
0
    private void NVCapNhatThongTinCaNhan()
    {
        NguoiDungDTO vkhDto     = (NguoiDungDTO)Session["nguoidung"];
        NguoiDungDTO vkhDto_new = new NguoiDungDTO(vkhDto);

        //Lấy tham số client truyền xuống
        vkhDto_new.Ho_ten    = XL_CHUOI.Nhap(Request, "hoten");
        vkhDto_new.Ngay_sinh = DateTime.Parse(Request["ngaysinh"]);

        vkhDto_new.Gioi_tinh  = bool.Parse((XL_CHUOI.Nhap(Request, "gioitinh")));
        vkhDto_new.Dia_chi    = XL_CHUOI.Nhap(Request, "diachi");
        vkhDto_new.Dien_thoai = XL_CHUOI.Nhap(Request, "dienthoai");
        vkhDto_new.Email      = XL_CHUOI.Nhap(Request, "email");

        //Cập nhật neu co thay doi
        bool kq = true;

        if (vkhDto_new.Ho_ten != vkhDto.Ho_ten || vkhDto_new.Ngay_sinh != vkhDto.Ngay_sinh || vkhDto_new.Gioi_tinh != vkhDto.Gioi_tinh || vkhDto_new.Dia_chi != vkhDto.Dia_chi || vkhDto_new.Dien_thoai != vkhDto.Dien_thoai || vkhDto_new.Email != vkhDto.Email)
        {
            NguoiDungBUS ndBus = new NguoiDungBUS();
            kq = ndBus.CapNhatThongTinNguoiDung(vkhDto_new);
        }

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

        //Cập nhật thành công
        if (kq == true)
        {
            Session["nguoidung"] = vkhDto_new;

            thuoc_tinh = new XL_THUOC_TINH("kq", "True");
        }
        else
        {
            thuoc_tinh = new XL_THUOC_TINH("kq", "False");
        }

        //Trả kết quả về client
        the.Danh_sach_thuoc_tinh.Add(thuoc_tinh);
        string chuoi = the.Chuoi();

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #24
0
    private void GuiMail()
    {
        string Username = (string)Request["Username"];
        string subject  = (string)Request["subject"];
        string body     = (string)Request["body"];

        NguoiDungBUS ndBus = new NguoiDungBUS();
        NguoiDungDTO dto   = ndBus.LayThongTinNguoiDung(Username);

        //bool flag = Utilities.SendMail("*****@*****.**", dto.Email, subject, body) == "";
        bool          flag      = true;
        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);
    }
コード例 #25
0
    public void LoadDSLoaiNguoiDung()
    {
        LoaiNguoiDungBUS lndBUS = new LoaiNguoiDungBUS();

        LoaiNguoiDungDTO[] dsLoaiNguoiDung = lndBUS.LayDanhSachLoaiNguoiDung();

        XL_THE Kq = new XL_THE("dsLoaiNguoiDung");

        for (int i = 0; i < dsLoaiNguoiDung.Length; ++i)
        {
            XL_THE Kq1 = new XL_THE("LoaiNguoiDung");
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("MaLoaiNguoiDung", dsLoaiNguoiDung[i].Ma_loai_nguoi_dung.ToString()));
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("TenLoaiNguoiDung", dsLoaiNguoiDung[i].Ten_loai_nguoi_dung));

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatChuoi(Response, Kq.Chuoi());
    }
コード例 #26
0
    protected void LayDanhSachLoaiThe()
    {
        LoaiTheBUS loaitheBUS = new LoaiTheBUS();

        LoaiTheDTO[] dsLoaiThe = loaitheBUS.LayDanhSachLoaiThe();

        XL_THE Kq = new XL_THE("dsLoaiThe");

        for (int i = 0; i < dsLoaiThe.Length; ++i)
        {
            XL_THE Kq1 = new XL_THE("LoaiThe");
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("MaLoaiThe", dsLoaiThe[i].Ma_loai_the.ToString()));
            Kq1.Danh_sach_thuoc_tinh.Add(new XL_THUOC_TINH("TenLoaiThe", dsLoaiThe[i].Ten_loai_the));

            Kq.Danh_sach_the.Add(Kq1);
        }

        XL_CHUOI.XuatChuoi(Response, Kq.Chuoi());
    }
コード例 #27
0
    void TongSoTrang()
    {
        MonAnBUS bus       = new MonAnBUS();
        int      tongsomon = bus.TongSoMonAn();
        int      kq        = -1;

        // không lỗi
        if (tongsomon != -1)
        {
            kq  = tongsomon / pageSize;
            kq += (tongsomon % pageSize != 0) ? 1 : 0;
        }
        XL_THE        the       = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh = new XL_THUOC_TINH("TongSoTrang", kq.ToString());

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #28
0
    public void Thoat()
    {
        Session["User"]              = null;
        Session["LoaiNguoiDung"]     = "";
        Session["khachhang"]         = null;
        Session["nguoidung"]         = null;
        Session["FormDatHang"]       = null;
        Session["FormDatHangDinhKy"] = null;
        Session["Gio_qua_tang"]      = null;
        Session["Gio_hang"]          = null;
        Session["Item_online"]       = null;

        XL_THE        the       = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh = new XL_THUOC_TINH("kq", "true");

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #29
0
    void TongSoTrang()
    {
        MonAnYeuDauDTO[] arr = bus.LayDSMonAnYeuThich(int.Parse(Session["MaNguoiDung"].ToString()));
        int tongsomon        = arr.Length;
        int kq = -1;

        // không lỗi
        if (tongsomon != -1)
        {
            kq  = tongsomon / pageSize;
            kq += (tongsomon % pageSize != 0) ? 1 : 0;
        }
        XL_THE        the       = new XL_THE("goc");
        XL_THUOC_TINH thuoctinh = new XL_THUOC_TINH("TongSoTrang", kq.ToString());

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

        XL_CHUOI.XuatChuoi(Response, chuoi);
    }
コード例 #30
0
    protected void LayDanhSachLoaiMonCon()
    {
        LoaiMonBUS loaimonBUS = new LoaiMonBUS();

        LoaiMonDTO[] dsLoaiMon = loaimonBUS.DanhSachLoaiMonCon(int.Parse(Request["MaLoaiMon"].ToString()));

        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());
    }