Exemplo n.º 1
0
        public bool CreateNewsSection(NewsSetion model)
        {
            string sql = @"INSERT INTO [dbo].[NewsSetion] ([CNName],[ENName] ,[CreateTime] ,[Status] ,[AccountsId],[Sort])
                       VALUES (@CNName,@ENName,@CreateTime,@Status,@AccountsId,@Sort)";

            using (var con = WriteConnection())
            {
                return(con.Execute(sql, model) > 0);
            }
        }
Exemplo n.º 2
0
        public ActionResult SectionEdit(int Id)
        {
            NewsSetion ns = new NewsSetion();

            ns.Id = -1;
            if (Id > 0)
            {
                ns = _component.GetNewsSectionById(Id);
            }
            return(View(ns));
        }
Exemplo n.º 3
0
        public bool UpdateNewsSection(NewsSetion model)
        {
            string sql = @"UPDATE [dbo].[NewsSetion] SET [CNName] = @CNName,[ENName] = @ENName,[Sort] = @Sort WHERE Id=@Id";

            using (var con = WriteConnection())
            {
                return(con.Execute(sql, new
                {
                    CNName = model.CNName,
                    ENName = model.ENName,
                    Sort = model.Sort,
                    Id = model.Id
                }) > 0);
            }
        }
Exemplo n.º 4
0
        public SaveResult UpdateNewsSection(NewsSetion model)
        {
            var result = new NewsDAC().UpdateNewsSection(model);

            return(new SaveResult(result));
        }