protected void btnAddBldgInfoSubmit_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtBldgnumber.Text.ToString()) == true)
            {
                LogMessage("Enter Bldg #");
                txtBldgnumber.Focus();
                return;
            }
            if (ddlAddress.SelectedIndex == 0)
            {
                LogMessage("Select Address");
                ddlAddress.Focus();
                return;
            }
            if (ddlType.SelectedIndex == 0)
            {
                LogMessage("Select Type");
                ddlType.Focus();
                return;
            }

            if (btnAddBldgInfoSubmit.Text == "Submit")
            {
                LeadBuildResult objLeadBuildResult = ProjectLeadBuildingsData.AddProjectLeadBldg((DataUtils.GetInt(hfProjectId.Value)), DataUtils.GetInt(txtBldgnumber.Text),
                                                                                                 DataUtils.GetInt(ddlAddress.SelectedValue.ToString()), DataUtils.GetInt(txtAge.Text), DataUtils.GetInt(ddlType.SelectedValue.ToString()),
                                                                                                 DataUtils.GetInt(txtLHCUnits.Text), cbFloodHazardArea.Checked, cbFloodInsurance.Checked, DataUtils.GetInt(ddlverifiedBy.SelectedValue.ToString()),
                                                                                                 txtInsuredby.Text, DataUtils.GetInt(ddlHistoricStatus.SelectedValue.ToString()), DataUtils.GetInt(ddlAppendixA.SelectedValue.ToString()));

                ClearBldgInfoForm();
                BindGrids();

                if (objLeadBuildResult.IsDuplicate && !objLeadBuildResult.IsActive)
                {
                    LogMessage("Building Info already exist as in-active");
                }
                else if (objLeadBuildResult.IsDuplicate)
                {
                    LogMessage("Building Info already exist");
                }
                else
                {
                    LogMessage("Building Info Added Successfully");
                }
            }
            else
            {
                ProjectLeadBuildingsData.UpdateProjectLeadBldg((DataUtils.GetInt(hfLeadBldgID.Value)), DataUtils.GetInt(txtBldgnumber.Text), DataUtils.GetInt(ddlAddress.SelectedValue.ToString()),
                                                               DataUtils.GetInt(txtAge.Text), DataUtils.GetInt(ddlType.SelectedValue.ToString()), DataUtils.GetInt(txtLHCUnits.Text), cbFloodHazardArea.Checked, cbFloodInsurance.Checked,
                                                               DataUtils.GetInt(ddlverifiedBy.SelectedValue.ToString()), txtInsuredby.Text, DataUtils.GetInt(ddlHistoricStatus.SelectedValue.ToString()),
                                                               DataUtils.GetInt(ddlAppendixA.SelectedValue.ToString()), chkBldgActive.Checked);

                gvBldgInfo.EditIndex = -1;
                BindGrids();
                hfLeadBldgID.Value = "";
                ClearBldgInfoForm();
                btnAddBldgInfoSubmit.Text = "Submit";

                LogMessage("Building Info Updated Successfully");
            }
        }
        protected void btnAddUnitInfo_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(txtUnitNumber.Text.ToString()) == true)
            {
                LogMessage("Enter Unit #");
                txtUnitNumber.Focus();
                return;
            }

            if (btnAddUnitInfo.Text == "Submit")
            {
                LeadBuildResult objLeadBuildResult = ProjectLeadBuildingsData.AddProjectLeadUnit((DataUtils.GetInt(hfLeadBldgID.Value)), DataUtils.GetInt(txtUnitNumber.Text),
                                                                                                 DataUtils.GetInt(ddlEBlStatus.SelectedValue.ToString()), DataUtils.GetInt(txtHouseholdCount.Text), DataUtils.GetInt(txtRooms.Text),
                                                                                                 DataUtils.GetDecimal(txtHouseholdIncome.Text), cbThirdPartyVerified.Checked, DataUtils.GetInt(ddlIncomeStatus.SelectedValue.ToString()),
                                                                                                 DataUtils.GetDecimal(txtMatchingFund.Text), DataUtils.GetDate(txtClearanceDate.Text), DataUtils.GetDate(txtCertifiedBy.Text), DataUtils.GetDate(txtCertifiedBy.Text));

                ClearUnitInfoForm();
                BindUnitsGrid();

                if (objLeadBuildResult.IsDuplicate && !objLeadBuildResult.IsActive)
                {
                    LogMessage("Unit Info already exist as in-active");
                }
                else if (objLeadBuildResult.IsDuplicate)
                {
                    LogMessage("Unit Info already exist");
                }
                else
                {
                    LogMessage("Unit Info Added Successfully");
                }
            }
            else
            {
                ProjectLeadBuildingsData.UpdateProjectLeadUnit((DataUtils.GetInt(hfLeadUnitID.Value)), DataUtils.GetInt(ddlEBlStatus.SelectedValue.ToString()),
                                                               DataUtils.GetInt(txtHouseholdCount.Text), DataUtils.GetInt(txtRooms.Text), DataUtils.GetDecimal(txtHouseholdIncome.Text), cbThirdPartyVerified.Checked,
                                                               DataUtils.GetInt(ddlIncomeStatus.SelectedValue.ToString()), DataUtils.GetDecimal(txtMatchingFund.Text), DataUtils.GetDate(txtClearanceDate.Text),
                                                               DataUtils.GetDate(txtCertifiedBy.Text), DataUtils.GetDate(txtCertifiedBy.Text), chkUnitActive.Checked);

                ClearUnitInfoForm();
                BindUnitsGrid();

                gvUnitInfo.EditIndex = -1;
                BindUnitsGrid();
                hfLeadUnitID.Value = "";
                ClearUnitInfoForm();
                btnAddUnitInfo.Text = "Submit";

                LogMessage("Unit Info Updated Successfully");
            }
        }