public bool Update(AMW.Model.Entity.MldPage model) { Dictionary <string, object> dic = new Dictionary <string, object>(); if (model.TitleValueFlag) { dic.Add("Title", model.Title); } if (model.KeyWordValueFlag) { dic.Add("KeyWord", model.KeyWord); } if (model.DescriptionValueFlag) { dic.Add("Description", model.Description); } if (model.IntroValueFlag) { dic.Add("Intro", model.Intro); } if (model.ContentValueFlag) { dic.Add("Content", model.Content); } return(DBHelper.Update("MldPage").Set(dic).Where("id=@1", model.ID).Execute() > 0); }
public int Add(AMW.Model.Entity.MldPage model) { Dictionary <string, object> dic = new Dictionary <string, object>(); if (model.TitleValueFlag) { dic.Add("Title", model.Title); } if (model.KeyWordValueFlag) { dic.Add("KeyWord", model.KeyWord); } if (model.DescriptionValueFlag) { dic.Add("Description", model.Description); } if (model.IntroValueFlag) { dic.Add("Intro", model.Intro); } if (model.ContentValueFlag) { dic.Add("Content", model.Content); } return(DBHelper.InsertInto("MldPage", dic)); }