private PropertyMetadataItem CreatePropertyMetadata(string propertyName, string message) { PropertyMetadataItem item = new PropertyMetadataItem(); item.Message = message; item.ErrorLevel = 1; item.PropertyName = propertyName; return item; }
private PropertyMetadataItem CreatePropertyMetadata(string propertyName, string message) { PropertyMetadataItem item = new PropertyMetadataItem(); item.Message = message; item.ErrorLevel = 1; item.PropertyName = propertyName; return(item); }
public void AddPropertyFeedback(string propertyName, int errorLevel, string message) { PropertyMetadataItem item = new PropertyMetadataItem(); item.Message = message; item.ErrorLevel = errorLevel; item.PropertyName = propertyName; item.Readonly = false; item.Visible = true; item.Enabled = true; this.AddPropertyFeedback(item); }
protected void AssurePropertyMetadata_Name(string propertyName, string value) { string message; this.Validate_Name(value, out message); if (message != null) { PropertyMetadataItem item = new PropertyMetadataItem(); item.Message = message; item.ErrorLevel = 1; item.PropertyName = propertyName; this.AddPropertyFeedback(item); } else { this.RemovePropertyFeedback(propertyName); } }
protected void AssurePropertyMetadata_SitePort(string propertyName, long value) { string message; this.Validate_SitePort(value, out message); if (message != null) { PropertyMetadataItem item = this.CreatePropertyMetadata(propertyName, message); this.AddPropertyFeedback(item); } else { this.RemovePropertyFeedback(propertyName); } }
public void AddPropertyFeedback(PropertyMetadataItem item) { // Assure only one property metadata/propertyname foreach (var obj in this.PropertyMetadataItems) { if (obj.PropertyName == item.PropertyName) { obj.Readonly = item.Readonly; obj.Visible = item.Visible; obj.Enabled = item.Enabled; obj.ErrorLevel = item.ErrorLevel; obj.Message = item.Message; return; } } this.PropertyMetadataItems.Add(item); }
protected void AssurePropertyMetadata_AddUserName(string propertyName, string value) { string message; this.Validate_AddUserName(value, out message); if (message != null) { PropertyMetadataItem item = new PropertyMetadataItem(); item.Message = message; item.ErrorLevel = 1; item.PropertyName = propertyName; this.AddUser_Feedback = item; } else { this.AddUser_Feedback = null; } }
protected void AssurePropertyMetadata_Name(string propertyName, string value) { string message; this.Validate_Name(value, out message); if (message != null) { PropertyMetadataItem item = new PropertyMetadataItem(); item.Message = message; item.ErrorLevel = 1; item.PropertyName = propertyName; this.AddPropertyFeedback(item); } else { this.RemovePropertyFeedback(propertyName); } }
/// <summary> /// AddUser operation invoked /// </summary> /// <param name="action"></param> void Handle(Input.AddUser action) { this.AssurePropertyMetadata_AddUserName("AddUserName$", this.AddUserName); if (this.AddUser_Feedback != null) { return; } Simplified.Ring3.SystemUser systemUser = Db.SQL <Simplified.Ring3.SystemUser>("SELECT o FROM Simplified.Ring3.SystemUser o WHERE o.Username=?", this.AddUserName).First; if (systemUser == null) { PropertyMetadataItem item = new PropertyMetadataItem(); item.Message = "User not found"; item.ErrorLevel = 1; item.PropertyName = "AddUser$"; this.AddUser_Feedback = item; return; } SystemUserAdmin.AddSystemUserToSystemUserGroup(systemUser, this.Data); this.AddUserName = string.Empty; }