/// <summary> /// Load controls lookup etc. /// </summary> /// <param name="ctx"></param> /// <param name="windowNo"></param> /// <param name="C_AcctSchema_ID"></param> /// <returns>class lookups</returns> public AccountSchema AccountSchemaLoad(Ctx ctx, int windowNo, int C_AcctSchema_ID) { AccountSchema objSchema = new AccountSchema(); MAcctSchemaElement[] elements = null; var _AcctSchema = new MAcctSchema(ctx, C_AcctSchema_ID, null); ctx.GetCtx(windowNo).SetContext(windowNo, "C_AcctSchema_ID", C_AcctSchema_ID); elements = _AcctSchema.GetAcctSchemaElements(); objSchema.IsHasAlies = _AcctSchema.IsHasAlias(); objSchema.Elements = new List <AccountingElements>(); for (int i = 0; i < elements.Length; i++) { AccountingElements obj = new AccountingElements(); MAcctSchemaElement ase = elements[i]; obj.Type = ase.GetElementType(); obj.IsMandatory = ase.IsMandatory(); obj.ID = ase.Get_ID(); obj.Name = ase.GetName(); obj.DefaultValue = ase.GetDefaultValue(); obj.SeqNo = ase.GetSeqNo(); obj.AD_Column_ID = ase.GetAD_Column_ID(); obj.IsHeavyData = Util.GetValueOfBool(ase.Get_Value("IsHeavyData")); objSchema.Elements.Add(obj); } objSchema.Description = _AcctSchema.ToString(); return(objSchema); }