public bool GreaterThanCollectCategoryId1(ForeignKeyFieldDefinition <TModel, int, Category> def) { if (def.ModelHasCode) { string code = def.GetCode(Model); SetField(def.FieldIndex - 1, code); } else { var nullable = def as NullableForeignKeyFieldDefinition <TModel, int, Category>; if (!def.IsNullable || nullable.GetNullableValue(Model) != null) { int id = def.GetValue(Model); IdResolutionQueue = StoreId(IdResolutionQueue, def, id); } } return(true); }
public bool CurrencyCodeForFee(ForeignKeyFieldDefinition <TModel, int, Currency> def, int foreignflg) { if (def.ModelHasCode) { string code = def.GetCode(Model); SetField(def.FieldIndex - 1, code); } else { var nullable = def as NullableForeignKeyFieldDefinition <TModel, int, Currency>; if (!def.IsNullable || nullable.GetNullableValue(Model) != null) { int id = def.GetValue(Model); IdResolutionQueue = StoreId(IdResolutionQueue, def, id); } } return(true); }
public bool PaymentAgencyCode(ForeignKeyFieldDefinition <TModel, int, PaymentAgency> def) { if (def.ModelHasCode) { string code = def.GetCode(Model); // FieldValues[def.FieldNumber - 1] = $"{code}".PadLeft(2, '0'); SetField(def.FieldIndex - 1, code?.PadLeft(2, '0')); } else { var nullable = def as NullableForeignKeyFieldDefinition <TModel, int, PaymentAgency>; if (!def.IsNullable || nullable.GetNullableValue(Model) != null) { int id = def.GetValue(Model); IdResolutionQueue = StoreId(IdResolutionQueue, def, id); } } return(true); }
public bool CustomerCodeForDiscount(ForeignKeyFieldDefinition <TModel, int, Customer> def) { if (def.ModelHasCode) { string code = def.GetCode(Model); if (DataExpression.CustomerCodeFormatString == "9") { code = code?.PadLeft(DataExpression.CustomerCodeLength, '0'); } SetField(def.FieldIndex - 1, code); } else { var nullable = def as NullableForeignKeyFieldDefinition <TModel, int, Customer>; if (!def.IsNullable || nullable.GetNullableValue(Model) != null) { int id = def.GetValue(Model); IdResolutionQueue = StoreId(IdResolutionQueue, def, id); } } return(true); }