Exemplo n.º 1
0
        public void Remove(Models.HtmlItem item)
        {
            DbCommand comm = this.GetCommand("HtmlItem_Delete");



            comm.AddParameter <string>(this.Factory, "Code", item.Code);
            comm.AddParameter <string>(this.Factory, "Culture", item.Culture);


            this.SafeExecuteNonQuery(comm);
        }
Exemplo n.º 2
0
        public Models.HtmlItem Get(Models.HtmlItem dummy)
        {
            DbCommand comm = this.GetCommand("HtmlItem_Get");



            comm.AddParameter <string>(this.Factory, "Code", dummy.Code);
            comm.AddParameter <string>(this.Factory, "Culture", dummy.Culture);


            DataTable dt = this.GetTable(comm);

            return(EntityBase.ParseListFromTable <HtmlItem>(dt).FirstOrDefault());
        }
Exemplo n.º 3
0
        public void Update(Models.HtmlItem @new, Models.HtmlItem old)
        {
            var item = @new;

            item.Code = old.Code;



            DbCommand comm = this.GetCommand("HtmlItem_Update");

            comm.AddParameter <string>(this.Factory, "Code", item.Code);
            comm.AddParameter <string>(this.Factory, "Culture", item.Culture);
            comm.AddParameter <string>(this.Factory, "Category", item.Category);
            comm.AddParameter <string>(this.Factory, "Description", item.Description);
            comm.AddParameter <string>(this.Factory, "Detail", item.Detail);



            this.SafeExecuteNonQuery(comm);
        }
Exemplo n.º 4
0
        public void Add(Models.HtmlItem item)
        {
            DbCommand comm = this.GetCommand("HtmlItem_Insert");

            comm.AddParameter <string>(this.Factory, "Code", item.Code);
            comm.AddParameter <string>(this.Factory, "Category", item.Category);
            comm.AddParameter <string>(this.Factory, "Description", item.Description);
            comm.AddParameter <string>(this.Factory, "Culture", item.Culture);
            comm.AddParameter <string>(this.Factory, "Detail", item.Detail);


            DbParameter itemIdParam = comm.AddParameter(this.Factory, "itemId", DbType.Int32, null);

            itemIdParam.Direction = ParameterDirection.Output;

            this.SafeExecuteNonQuery(comm);


            item.Id = Convert.ToInt32(itemIdParam.Value);
        }