private void btnSearchDisHomeID_Click(object sender, EventArgs e)
        {
            if (homeDisplayLookupForm == null)
            {
                homeDisplayLookupForm = new frmHomeDisplayLookup();
            }
            homeDisplayLookupForm.ShowDialog();

            if (homeDisplayLookupForm.SelectedHomeDisplay != null && (homeDisplayLookupForm.SelectedHomeDisplay.RowState == DataRowState.Unchanged))
            {
                DataRow row = homeDisplayLookupForm.SelectedHomeDisplay;
                txtDisHomeID.Text   = row["HomeID"].ToString();
                txtDisHomeID2.Text  = row["HomeID"].ToString();
                txtDisHomeName.Text = row["HomeName"].ToString();
                label3.Text         = row["suburb"].ToString();
                label5.Text         = row["lotaddress"].ToString();
                label6.Text         = row["brandname"].ToString();
            }
        }
Exemplo n.º 2
0
        private void btnLookupHomeDisplay_Click(object sender, EventArgs e)
        {
            if (homeDisplayLookupForm == null)
            {
                homeDisplayLookupForm = new frmHomeDisplayLookup();
            }
            homeDisplayLookupForm.ShowDialog();

            if (homeDisplayLookupForm.SelectedHomeDisplay != null && (homeDisplayLookupForm.SelectedHomeDisplay.RowState == DataRowState.Unchanged))
            {
                DataRow row = homeDisplayLookupForm.SelectedHomeDisplay;
                this.txtHomeID.Text            = row["HomeID"].ToString();
                this.txtOriginalDisHomeID.Text = row["HomeID"].ToString();
                this.txtParentHomeID.Text      = row["parentHomeID"].ToString();
                this.txtOriginalHomeID.Text    = row["parentHomeID"].ToString();
                this.labelPhome.Text           = row["ParentHomename"].ToString();
                this.txtHomePlan.Text          = row["HomePlan"].ToString();
                this.txtHomeFacade.Text        = row["Facade"].ToString();

                dropdownState.Enabled            = true;
                this.dropdownState.SelectedValue = row["fkStateID"].ToString();
                dropdownState.Enabled            = false;

                dropBrand.Enabled = true;
                LoadBrandList();
                this.dropBrand.SelectedValue = row["BrandID"].ToString();
                dropBrand.Enabled            = false;
                oldBrandID = Int32.Parse(row["BrandID"].ToString());

                if (row["BrandID"].ToString() == "24") // this regional victoria
                {
                    lblFacade.Visible  = false;
                    dropFacade.Visible = false;
                    loadFacadeDropDown("0"); // from parenthome button
                    //dropFacade_SelectedIndexChanged(null, null);
                    dropFacade_SelectionChangeCommitted(null, null);
                }
                else
                {
                    lblFacade.Visible  = false;
                    dropFacade.Visible = false;
                }

                //LoadRegion();
                LoadSuburb();
                LoadEstate();

                this.txtProductID.Text           = row["ProductID"].ToString();
                oldProductID                     = row["ProductID"].ToString();
                this.txtHouseArea.Text           = row["HouseArea"].ToString();
                this.txtHouseAreaSquares.Text    = row["HouseAreaSquares"].ToString();
                this.txtAlfrescoArea.Text        = row["AlfrescoArea"].ToString();
                this.txtAlfrescoAreaSquares.Text = row["AlfrescoAreaSquares"].ToString();
                this.txtGarageArea.Text          = row["GarageArea"].ToString();
                this.txtGarageAreaSquares.Text   = row["GarageAreaSquares"].ToString();
                this.txtTotalArea.Text           = row["TotalArea"].ToString();
                this.txtTotalAreaSquares.Text    = row["TotalAreaSquares"].ToString();
                this.txtMinimumBlockWidth.Text   = row["Min_Block_Width"].ToString();
                this.txtHouseLength.Text         = row["HouseLength"].ToString();
                this.txtHouseWidth.Text          = row["HouseWidth"].ToString();
                this.txtGarageBays.Text          = row["GarageBays"].ToString();
                this.dropBedrooms.Text           = row["Bedrooms"].ToString();
                this.dropBathrooms.Text          = row["Bathrooms"].ToString();
                this.dropStoreys.Text            = row["Stories"].ToString();
                this.txtSortOrder.Text           = row["SortOrder"].ToString();
                this.chkActive.Checked           = bool.Parse(row["Active"].ToString());
                if (row["underReview"] != null && row["underReview"].ToString() != "")
                {
                    this.chkDraft.Checked = bool.Parse(row["underReview"].ToString());
                }
                else
                {
                    this.chkDraft.Checked = false;
                }
                this.txtDesc.Text        = row["DESC"].ToString();
                this.txtEdesc.Text       = row["EDESC"].ToString();
                this.txtCstctr.Text      = row["CSTCTR"].ToString();
                this.txtSuofm.Text       = row["SUOFM"].ToString();
                this.txtPuofm.Text       = row["PUOFM"].ToString();
                this.txtPrdcat.Text      = row["PRDCAT"].ToString();
                this.txtTaxcd.Text       = row["TAXCD"].ToString();
                this.txtPrdsop.Text      = row["PRDSOP"].ToString();
                this.txtUsrdef.Text      = row["USRDEF"].ToString();
                this.txtLdesc.Text       = row["LDESC"].ToString();
                this.txtBrand.Text       = row["Brand"].ToString();
                this.txtSpecyear.Text    = row["SpecYear"].ToString();
                this.txtHousecode.Text   = row["HouseCode"].ToString();
                this.txtHousesize.Text   = row["HouseSize"].ToString();
                this.txtHousefacade.Text = row["HouseFacade"].ToString();
                this.txtStorey.Text      = row["Storey"].ToString();
                this.txtMark.Text        = row["Mark"].ToString();

                if (row["displayclosedate"].ToString() != null && row["displayclosedate"].ToString() != "")
                {
                    this.txtclosedate.Text     = DateTime.Parse(row["displayclosedate"].ToString()).ToString("dd/MM/yyyy");
                    this.dateTimePicker1.Value = DateTime.Parse(row["displayclosedate"].ToString());
                }
                else
                {
                    dateTimePicker1.Value  = DateTime.Today.AddHours(5);
                    this.txtclosedate.Text = "";
                }

                this.txtLotAddress.Text = row["lotAddress"].ToString();
                //this.txtSuburb.Text = "";
                if (row["blocksize"].ToString() == "0")
                {
                    this.txtBlockSize.Text = "";
                }
                else
                {
                    this.txtBlockSize.Text = row["blocksize"].ToString();
                }
                //if (row["regionID"].ToString() != "")
                //{
                //    if (dropRegion.FindString(row["regionID"].ToString())>0)
                //    {
                //        this.dropRegion.SelectedValue = Int32.Parse(row["regionID"].ToString());
                //    }
                //    else
                //    {
                //        this.dropRegion.SelectedIndex = 0;
                //    }
                //}
                //else
                //{
                //    this.dropRegion.SelectedIndex =0;
                //}

                dropSuburb.SelectedItem = row["suburb"];
                //this.dropSuburb.SelectedValue = row["suburb"].ToString();
                //this.dropEstate.SelectedValue = row["fkidestate"].ToString();
                this.dropEstate.SelectedItem = row["estatename"].ToString();


                ViewRead();

                btnSaveData.Enabled = false;
                btnEdit.Enabled     = true;
                btnCopy.Enabled     = true;
            }
        }