public void Update(int Id, int ModuleId, string Culture, int StatusId, string ShortDescription, string LongDescription, string ImagePath, bool IsFeatured, string Tags) { MasterDetailItem item = new MasterDetailItem(); item.MarkOld(); item.IsLoaded = true; item.Id = Id; item.ModuleId = ModuleId; item.Culture = Culture; item.StatusId = StatusId; item.ShortDescription = ShortDescription; item.LongDescription = LongDescription; item.ImagePath = ImagePath; item.IsFeatured = IsFeatured; item.Tags = Tags; item.Save(UserName); }
public void Insert(int ModuleId, string Culture, int StatusId, string ShortDescription, string LongDescription, string ImagePath, bool IsFeatured, string Tags) { MasterDetailItem item = new MasterDetailItem(); item.ModuleId = ModuleId; item.Culture = Culture; item.StatusId = StatusId; item.ShortDescription = ShortDescription; item.LongDescription = LongDescription; item.ImagePath = ImagePath; item.IsFeatured = IsFeatured; item.Tags = Tags; item.CreatedOn = DateTime.Now; item.CreatedBy = UserName; item.Save(UserName); }
///// <summary> ///// Isolated=true indicates that the module should behave normally, that is, ///// an initial module instance is automatically saved by EnsureModule(). ///// Isolated=false indicates that this module is a child of a ///// MasterDetail List module; in this case, the module will not be saved ///// until the user clicks the save button. ///// </summary> //public bool Isolated //{ // get { return (bool)(ViewState["Isolated"] ?? true); } // set { ViewState["Isolated"] = value; } //} /// <summary> /// Checks that the custom module data exists. If the custom module /// object cannot be retrieved (e.g., this is the initial creation of /// the module), then a new module object is created using the module /// id assigned by the CMS. /// </summary> override protected void EnsureModule() { MasterDetailItem module = MasterDetailItem.GetResource(this.ModuleId); if (null == module) { module = new MasterDetailItem(); module.ModuleId = this.ModuleId; module.Culture = WM.CultureCode.Current; module.Save(); } }