public override string GetDefaultCSS() { var m = Module.Read(ModuleId); if (ModuleId == 0) { return(""); } string css = m.CSS; if (string.IsNullOrWhiteSpace(css)) { css = m.GetDefaultCSS(); } string mId = String.Format("#{0}", m.Name, m.Id); string thisId = String.Format("#{0}", getCSSId()); return(css.Replace(mId, thisId)); }
public override void BeforeSave() { base.BeforeSave(); if (this.rows < 1 || this.rows > 30 || this.cols < 1 || this.cols > 30) { throw new Exception(Provider.GetResource("Row and column numbers must be between 1 and 30")); } string regionId = "tblCell" + this.Id; //TODO: aşağıdaki fasilite yanlış çalışıyor.. Fazla modül siliyor. if (Id > 0) { // silinecek cell'leri bulalım Module[] modules = Module.Read(Provider.Database.GetDataTable("select * from [Module] where Region > '" + (regionId + "_" + this.Rows) + "_' UNION ALL select * from [Module] where Region like '" + regionId + "_%' and substring(Region, " + (regionId.Length + 4) + ", 1)>='" + this.Cols + "' and Template='" + this.Template + "';")); // ve tek tek silelim foreach (Module module in modules) { module.Delete(); } } }