Exemple #1
0
        public SingleRsp UpdateTinTuc(TinTucReq req)
        {
            var res = new SingleRsp();

            try
            {
                TinTuc c = new TinTuc();
                c.Idtintuc  = req.Idtintuc;
                c.Tieude    = req.Tieude;
                c.Tomtat    = req.Tomtat;
                c.Noidung   = req.Noidung;
                c.UrlHinh   = req.UrlHinh;
                c.Ngaydang  = req.Ngaydang;
                c.Solanxem  = req.Solanxem;
                c.Keyword   = req.Keyword;
                c.Tinnoibat = req.Tinnoibat;
                c.Anhientin = req.Anhientin;
                c.Idloaitin = req.Idloaitin;
                //
                res      = base.Update(c);
                res.Data = c;
            }
            catch (Exception ex)
            {
                res.SetError(ex.StackTrace);
            }

            return(res);
        }
Exemple #2
0
        //moi tinh
        public SingleRsp DeleteTinTuc(TinTucReq tt)
        {
            var    res    = new SingleRsp();
            TinTuc tintuc = new TinTuc();

            tintuc.Idtintuc  = tt.Idtintuc;
            tintuc.Tieude    = tt.Tieude;
            tintuc.Tomtat    = tt.Tomtat;
            tintuc.Noidung   = tt.Noidung;
            tintuc.UrlHinh   = tt.UrlHinh;
            tintuc.Ngaydang  = tt.Ngaydang;
            tintuc.Solanxem  = tt.Solanxem;
            tintuc.Keyword   = tt.Keyword;
            tintuc.Tinnoibat = tt.Tinnoibat;
            tintuc.Anhientin = tt.Anhientin;
            tintuc.Idloaitin = tt.Idloaitin;
            res = _rep.DeleteTinTuc(tintuc);
            return(res);
        }
Exemple #3
0
        public IActionResult UpdateTinTuc(TinTucReq req)
        {
            var res = _svc.UpdateTinTuc(req);

            return(Ok(res));
        }
        public IActionResult DeleteTinTuc([FromBody] TinTucReq req)
        {
            var res = _svc.DeleteTinTuc(req);

            return(Ok(res));
        }