private static void SetBO1_BO2_J(MyBO bo, ISession s, TBO1_BO2_J value, Action <MyRef2, int?> set) { switch (value) { case TBO1_BO2_J.Null: bo.BO1 = null; break; case TBO1_BO2_J.BO1: bo.GetOrCreateBO1(s).BO2 = null; break; case TBO1_BO2_J.ValueNull: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), null); break; case TBO1_BO2_J.Zero: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 0); break; case TBO1_BO2_J.One: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 1); break; default: throw new Exception("Value " + value + " not handled in code"); } }
public static void SetBO1_BO3_L1(MyBO bo, ISession s, TBO1_BO3_L value) { switch (value) { case TBO1_BO3_L.Null: bo.BO1 = null; break; case TBO1_BO3_L.BO1: bo.GetOrCreateBO1(s).BO3 = null; break; case TBO1_BO3_L.ValueNull: bo.GetOrCreateBO1(s).GetOrCreateBO3(s).L1 = 0; // L1 is int, not int? break; case TBO1_BO3_L.Zero: bo.GetOrCreateBO1(s).GetOrCreateBO3(s).L1 = 0; break; case TBO1_BO3_L.One: bo.GetOrCreateBO1(s).GetOrCreateBO3(s).L1 = 1; break; default: throw new Exception("Value " + value + " not handled in code"); } }
private static void SetBO1_I(MyBO bo, ISession s, TBO1_I value, Action <MyRef1, int?> set) { switch (value) { case TBO1_I.Null: bo.BO1 = null; break; case TBO1_I.ValueNull: set(bo.GetOrCreateBO1(s), null); break; case TBO1_I.Zero: set(bo.GetOrCreateBO1(s), 0); break; case TBO1_I.One: set(bo.GetOrCreateBO1(s), 1); break; default: throw new NotImplementedException("Value " + value + " not handled in code"); } }
private static void SetBO1_BO2_J(MyBO bo, ISession s, TBO1_BO2_J value, Action<MyRef2, int?> set) { switch (value) { case TBO1_BO2_J.Null: bo.BO1 = null; break; case TBO1_BO2_J.BO1: bo.GetOrCreateBO1(s).BO2 = null; break; case TBO1_BO2_J.ValueNull: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), null); break; case TBO1_BO2_J.Zero: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 0); break; case TBO1_BO2_J.One: set(bo.GetOrCreateBO1(s).GetOrCreateBO2(s), 1); break; default: throw new Exception("Value " + value + " not handled in code"); } }