protected void GetArea(int locationId)
        {

            BaoProperty baProperty = new BaoProperty();
            drpDwnArea.DataSource = baProperty.GetArea(locationId);
            drpDwnArea.DataTextField = "AreaName";
            drpDwnArea.DataValueField = "AreaId";
            drpDwnArea.DataBind();
            drpDwnArea.Items.Insert(0, new ListItem("Select", "0"));
        }
        protected void GetLocations()
        {
            BaoProperty baProperty = new BaoProperty();
            drpDwnLocation.DataSource = baProperty.GetLocations();
            drpDwnLocation.DataTextField = "locationName";
            drpDwnLocation.DataValueField = "locationId";
            drpDwnLocation.DataBind();
            drpDwnLocation.Items.Insert(0, new ListItem("Select", "0"));
            //GetArea( locationId);

        }
        protected void SaveProperty_Click(object sender, EventArgs e)
        {

            PropertyModel newproperty = new PropertyModel();
            if (drpDwnArea.SelectedValue != "Select")
            {
                newproperty.AreaId = Int32.Parse(drpDwnArea.SelectedValue);
                newproperty.BuildingName = txtBuildingName.Text;
                newproperty.FlatNo = Int32.Parse(txtFlatNo.Text);
                newproperty.PinNo = Int64.Parse(txtPinNo.Text);
                if(Session["UserDetails"]!=null)
                newproperty.CreatedBy = (Session["UserDetails"] as LoginModel).UserId;
                //newproperty.CreatedBy = Session["User"].ToString();
                BaoProperty baProperty = new BaoProperty();
                baProperty.InsertProperty(newproperty);
            }
           

            
            
            
          
       
     }