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); } }
public ActionResult SectionEdit(int Id) { NewsSetion ns = new NewsSetion(); ns.Id = -1; if (Id > 0) { ns = _component.GetNewsSectionById(Id); } return(View(ns)); }
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); } }
public SaveResult UpdateNewsSection(NewsSetion model) { var result = new NewsDAC().UpdateNewsSection(model); return(new SaveResult(result)); }