Esempio n. 1
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);
    }