Ejemplo n.º 1
0
        private static EnhancementSlotModel Create(DbDataReader reader)
        {
            EnhancementSlotModel model;

            model = new EnhancementSlotModel();
            model.Load(reader);

            return(model);
        }
Ejemplo n.º 2
0
        public void Delete()
        {
            QueryInformation query;

            if (this.Id == Guid.Empty)
            {
                Debug.WriteLine("Error: You can delete this record as an actual Database record doesn't exist for it. EnhancementTreeModel : Delete()");
                return;
            }

            //We need to delete any associated records before deleting this one
            EnhancementSlotModel.DeleteAllByEnhancementTreeId(this.Id);

            //we need to remove any Enhancement entries in other tables for this feat

            query = QueryInformation.Create(EnhancementTreeModel.DeleteQuery);

            query.CommandType = CommandType.Text;
            query.Parameters.Add(new QueryParameter("@" + EnhancementTreeModel.IdField, DbType.Guid, this.Id));
            BaseModel.RunCommand(query);

            //lets rest the id to empty so that the model knows it is now a new record if the save method is called.
            this.Id = Guid.Empty;
        }