Exemple #1
0
        public void cboBuildingType_SelectedIndexChanged()
        {
            //if (_order.BuildingType == _screen.BuildingType)
            //    return;

            _order.SetFrame(_screen.BuildingType);

            _screen.BuildingType   = _order.BuildingType;
            _screen.ReceptionRooms = _order.ReceptionRooms.ToString();
            _screen.Bathrooms      = _order.Bathrooms.ToString();
            _screen.Bedrooms       = _order.Bedrooms.ToString();

            _screen.ClearBuildingOptions();

            DataSet ds = BuildingGateway.Options(_screen.BuildingType);

            foreach (DataRow option in ds.Tables[0].Rows)
            {
                String[] row = new String[4];
                row[0] = option["id"].ToString();
                row[1] = option["optionname"].ToString();
                row[2] = option["optionprice"].ToString();
                row[3] = option["optiontype"].ToString();

                _screen.AddBuildingOption(row);
            }

            RefreshPrice();
        }
Exemple #2
0
        private void OrdersForm_Load(object sender, EventArgs e)
        {
            DataSet ds = BuildingGateway.List();

            cboBuildingType.DataSource    = ds.Tables[0];
            cboBuildingType.DisplayMember = "TypeCode";
            cboBuildingType.ValueMember   = "TypeCode";
        }
        public BuildingOptionDecorator(IBuilding buildingBase, String optionId)
            : base(buildingBase)
        {
            DataSet ds = BuildingGateway.FindOption(optionId);

            if (ds.Tables[0].Rows.Count > 0)
            {
                this.m_name  = (String)ds.Tables[0].Rows[0]["OptionName"];
                this.m_price = (Decimal)ds.Tables[0].Rows[0]["OptionPrice"];
            }
        }
        private void Initialise()
        {
            _screen.EnableControls(false); // Disables textboxes until user selects a customer or clicks 'New'

            DataSet ds = BuildingGateway.List();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                _screen.AddBuildingType(dr[1].ToString());
            }
        }
Exemple #5
0
        public FrameBase(String name)
        {
            DataSet ds = BuildingGateway.Find(name);

            _name             = name;
            _price            = (Decimal)ds.Tables[0].Rows[0]["FramePrice"];
            _bedrooms         = (int)ds.Tables[0].Rows[0]["Bedrooms"];
            _bathrooms        = (int)ds.Tables[0].Rows[0]["Bathrooms"];
            _receptionRooms   = (int)ds.Tables[0].Rows[0]["Reception"];
            _area             = (int)ds.Tables[0].Rows[0]["Area"];
            _constructionDays = (int)ds.Tables[0].Rows[0]["ConstructionDays"];
        }
Exemple #6
0
        public FrameBase(String name)
        {
            // Read definition for this building type from the building definitions table
            // Use the BuildingGateway fro all SQL I/O

            DataSet ds = BuildingGateway.Find(name);

            _name             = name;
            _price            = (Decimal)ds.Tables[0].Rows[0]["FramePrice"];
            _bedrooms         = (int)ds.Tables[0].Rows[0]["Bedrooms"];
            _bathrooms        = (int)ds.Tables[0].Rows[0]["Bathrooms"];
            _receptionRooms   = (int)ds.Tables[0].Rows[0]["Reception"];
            _area             = (int)ds.Tables[0].Rows[0]["Area"];
            _constructionDays = (int)ds.Tables[0].Rows[0]["ConstructionDays"];
        }
        public BuildingOptionDecorator(IBuilding buildingBase, String optionId)
            : base(buildingBase)
        {
            // Assign base
            m_buildingBase = buildingBase;

            // read definition for this instance of decorator from decorator table using the decorator gateway
            DataSet ds = BuildingGateway.FindOption(optionId);

            if (ds.Tables[0].Rows.Count > 0)
            {
                m_name  = (String)ds.Tables[0].Rows[0]["OptionName"];
                m_price = (Decimal)ds.Tables[0].Rows[0]["OptionPrice"];
            }
        }
Exemple #8
0
        private void Initialise()
        {
            DataSet ds = BuildingGateway.List();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                _screen.AddBuildingType(dr[1].ToString());
            }

            if (_order.OrderId != "-1")
            {
                _screen.CustomerId   = _order.CustomerId;
                _screen.BuildingType = _order.BuildingType;
                _screen.grpCustomerSearch_Enable(false);
            }
            else
            {
                _screen.grpCustomerSearch_Enable(true); // Disables textboxes until user selects a customer or clicks 'New'
            }
        }
Exemple #9
0
        private void BuildingOptionsSelectForm_Load(object sender, EventArgs e)
        {
            DataSet ds = BuildingGateway.Options(_buildingType);

            vwOptions.DataSource = ds.Tables[0];
        }