Пример #1
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);
    }
Пример #2
0
    public int ThemMonAn(MonAnDTO monan, String strTag)
    {
        MonAnBUS monanBUS = new MonAnBUS();

        return(monanBUS.ThemMonAn(monan, strTag));
    }