Exemplo n.º 1
0
        protected override void BuildDetail()
        {
            if (ItemGuid != null)
            {
                var dr = DataAccess.SingleChoice.GetSingleChoice(ItemGuid.Value);

                if (dr != null)
                {
                    FloatingRate = Convert.ToBoolean(dr["FloatingRate"]);

                    Result = Convert.IsDBNull(dr["Result"]) ? null : Convert.ToString(dr["Result"]);
                }

                var dt = DataAccess.ChoiceOption.GetChoiceOptions(ItemGuid.Value);

                foreach (DataRow drOption in dt.Rows)
                {
                    var option = new ChoiceOption
                    {
                        CasinoItemGuid = (Guid)drOption["CasinoItemGuid"],
                        OptionValue    = Convert.ToString(drOption["OptionValue"]),
                        OptionDisplay  = Convert.ToString(drOption["OptionDisplay"])
                    };

                    if (Convert.IsDBNull(drOption["OptionRate"]))
                    {
                        option.OptionRate = null;
                    }
                    else
                    {
                        option.OptionRate = Convert.ToSingle(drOption["OptionRate"]);
                    }

                    option.OrderID = Convert.ToInt32(drOption["OrderID"]);

                    Options.Add(option);
                }
            }
        }
Exemplo n.º 2
0
        protected override void BuildDetail()
        {
            if (ItemGuid != null)
            {
                var dr = DataAccess.SingleChoice.GetSingleChoice(ItemGuid.Value);

                if (dr != null)
                {
                    FloatingRate = Convert.ToBoolean(dr["FloatingRate"]);

                    Result = Convert.IsDBNull(dr["Result"]) ? null : Convert.ToString(dr["Result"]);
                }

                var dt = DataAccess.ChoiceOption.GetChoiceOptions(ItemGuid.Value);

                foreach (DataRow drOption in dt.Rows)
                {
                    var option = new ChoiceOption
                    {
                        CasinoItemGuid = (Guid) drOption["CasinoItemGuid"],
                        OptionValue = Convert.ToString(drOption["OptionValue"]),
                        OptionDisplay = Convert.ToString(drOption["OptionDisplay"])
                    };

                    if (Convert.IsDBNull(drOption["OptionRate"]))
                        option.OptionRate = null;
                    else
                        option.OptionRate = Convert.ToSingle(drOption["OptionRate"]);

                    option.OrderID = Convert.ToInt32(drOption["OrderID"]);

                    Options.Add(option);
                }
            }
        }