public string SaveAttribute(VA005_SaveAttribute value) { MAttribute obj = new MAttribute(_ctx, value.ID, null); obj.SetName(value.name); if (value.description != null) { obj.SetDescription(value.description); } else { obj.SetDescription(" "); } if (value.attributetype != null) { obj.SetAttributeValueType(value.attributetype); } else { obj.SetAttributeValueType("L"); } obj.SetIsMandatory(value.mandatory); obj.SetIsActive(value.isactivefield); obj.SetIsInstanceAttribute(value.istanceattribute); //obj.Save(); if (obj.Save()) { return(obj.GetM_Attribute_ID().ToString()); } // mattributeid = obj.GetM_Attribute_ID(); //} //if (value.secname != null) //{ // MAttributeValue objattval = new MAttributeValue(_ctx, 0, null); // objattval.SetName(value.secname); // objattval.SetValue(value.searchkey); // objattval.SetM_Attribute_ID(mattributeid); // if (objattval.Save()) // { // return objattval.GetM_AttributeValue_ID().ToString(); // } //} return(Msg.GetMsg(_ctx, "VA005_UnableToSaveAttribute")); }
/// <summary> /// Add New Selection List... /// </summary> /// <param name="values"></param> /// <returns></returns> public string AddNewAttribute(VA005_AddNewAttribute values) { MAttribute ctrl = new MAttribute(_ctx, 0, null); ctrl.SetName(values.Name); ctrl.SetDescription(values.Description); ctrl.SetM_AttributeSearch_ID(values.M_AttributeSearch_ID); if (ctrl.Save()) { return(ctrl.GetM_Attribute_ID().ToString()); } return(Msg.GetMsg(_ctx, "VA005_UnableToAddNewAttribute")); }