/// <summary> /// / /// </summary> /// <param name="clientid"></param> /// <param name="componentId"></param> /// <param name="attribute"></param> /// <returns></returns> public JsonpResult AddAttribute(string clientid, string componentId, string attribute) { // Tz.Net.ClientServer c = new Net.ClientServer(clientid); Models.Attribute att = new Models.Attribute(); att = Newtonsoft.Json.JsonConvert.DeserializeObject <Models.Attribute>(attribute); Core.ComponentManager mg = new ComponentManager(clientid, componentId); var natt = new ComponentAttribute(clientid) { AttributeName = att.AttributeName, AttributeType = (Core.ComponentAttribute.ComoponentAttributeType)att.AttributeType, ClientID = clientid, DefaultValue = att.DefaultValue, FileExtension = att.FileExtension, IsAuto = att.IsAuto, IsCore = att.IsCore, IsNullable = att.IsNullable, IsPrimaryKey = att.IsPrimaryKey, IsReadOnly = att.IsReadOnly, IsRequired = att.IsRequired, IsSecured = att.IsSecured, IsUnique = att.IsUnique, Length = att.Length, RegExp = att.RegExp }; natt.setFieldID(att.FieldID); if (att.FieldID != "") { return(new JsonpResult(mg.ChangeAttribute(natt))); } else { return(new JsonpResult(mg.AddAttribute(natt))); } }