public string GetFirstSteetingName(string brandName) { var cmdText = "SELECT TOP 1 SettingName FROM V_AllVechicles WHERE BrandName=@BrandName"; return(DABase.NewContext().AddCommandText(cmdText) .AddParameter("BrandName", brandName, DbType.String) .ExecuteScalar <string>()); }
public int InsertUpdateContent(ContentsDTO content) { return(DABase.NewContext().AddStoredProcedure("usp_InsertUpdateContent") .AddParameter("Id", content.ID, DbType.Int32) .AddParameter("HTMLContent", content.HTMLContent, DbType.String) .AddParameter("Description", content.Description) .AddParameter("CanEdit", content.CanEdit, DbType.Boolean) .AddParameter("Seq", content.Seq, DbType.Int32) .ExecuteNonquery()); }
public List <ContentsDTO> SearchAllContents() { SqlCommand command = new SqlCommand(); command.CommandText = "SELECT Id,HTMLContent,Description,CanEdit,Seq FROM dbo.Contents"; command.CommandType = CommandType.Text; return(CacheHelper.GetOrSetCache <List <ContentsDTO> >("k_content", command, true, () => { return DABase.NewContext().AddStoredProcedure("usp_SelectContentsAll").Query <ContentsDTO>(); })); }
public int DeleteContentByID(int id) { return(DABase.NewContext().AddStoredProcedure("usp_DeleteContent") .AddParameter("Id", id, DbType.Int32) .ExecuteNonquery()); }