예제 #1
0
        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>());
        }
예제 #2
0
 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());
 }
예제 #3
0
        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>();
            }));
        }
예제 #4
0
 public int DeleteContentByID(int id)
 {
     return(DABase.NewContext().AddStoredProcedure("usp_DeleteContent")
            .AddParameter("Id", id, DbType.Int32)
            .ExecuteNonquery());
 }