Exemplo n.º 1
0
        private void LoadManholeData(int assetId)
        {
            ManholeRehabilitationManholeDetailsGateway manholeRehabilitationManholeDetailsGateway = new ManholeRehabilitationManholeDetailsGateway(manholeRehabilitationTDS);
            if (manholeRehabilitationManholeDetailsGateway.Table.Rows.Count > 0)
            {
                // Load Manhole Details for header
                tbxManholeNumber.Text = manholeRehabilitationManholeDetailsGateway.GetMHID(assetId);

                tbxStreet.Text = manholeRehabilitationManholeDetailsGateway.GetAddress(assetId);
                tbxLongitude.Text = manholeRehabilitationManholeDetailsGateway.GetLongitude(assetId);
                tbxLatitude.Text = manholeRehabilitationManholeDetailsGateway.GetLatitud(assetId);

                if (manholeRehabilitationManholeDetailsGateway.GetManholeShape(assetId) == "")
                {
                    ddlShape.SelectedValue = "";
                    hdfSavedShape.Value = "";
                }
                else
                {
                    ddlShape.SelectedValue = manholeRehabilitationManholeDetailsGateway.GetManholeShape(assetId);
                    hdfSavedShape.Value = manholeRehabilitationManholeDetailsGateway.GetManholeShape(assetId);
                }

                if (manholeRehabilitationManholeDetailsGateway.GetMaterialID(assetId).HasValue)
                {
                    int? materialId = manholeRehabilitationManholeDetailsGateway.GetMaterialID(assetId);
                    int materialsId = (int)materialId;
                    ddlMaterial.SelectedValue = materialsId.ToString();
                }
                else
                {
                    ddlMaterial.SelectedIndex = 0;
                }

                if (manholeRehabilitationManholeDetailsGateway.GetLocation(assetId) == "")
                {
                    ddlLocation.SelectedValue = "";
                }
                else
                {
                    ddlLocation.SelectedValue = manholeRehabilitationManholeDetailsGateway.GetLocation(assetId);
                }

                if (manholeRehabilitationManholeDetailsGateway.GetConditionRating(assetId).HasValue)
                {
                    ddlConditioningRating.SelectedValue = manholeRehabilitationManholeDetailsGateway.GetConditionRating(assetId).ToString();
                }
                else
                {
                    ddlConditioningRating.SelectedValue = "-1";
                }
            }
        }
Exemplo n.º 2
0
        private void LoadManholeGeneralDetailDate(int assetId, ManholeRehabilitationManholeDetailsGateway manholeRehabilitationManholeDetailsGateway)
        {
            // Load Manhole Details for header
            tbxManholeNumber.Text = manholeRehabilitationManholeDetailsGateway.GetMHID(assetId);

            tbxStreet.Text = manholeRehabilitationManholeDetailsGateway.GetAddress(assetId);
            tbxLongitude.Text = manholeRehabilitationManholeDetailsGateway.GetLongitude(assetId);
            tbxLatitude.Text = manholeRehabilitationManholeDetailsGateway.GetLatitud(assetId);
            tbxShape.Text = manholeRehabilitationManholeDetailsGateway.GetManholeShape(assetId);
            if (manholeRehabilitationManholeDetailsGateway.GetMaterialID(assetId).HasValue)
            {
                int companyId = Int32.Parse(hdfCompanyId.Value);
                int? materialId = manholeRehabilitationManholeDetailsGateway.GetMaterialID(assetId);
                AssetSewerMHMaterialTypeGateway assetSewerMHMaterialTypeGateway = new AssetSewerMHMaterialTypeGateway();
                assetSewerMHMaterialTypeGateway.LoadByMaterialId((int)materialId, companyId);

                tbxMaterial.Text = assetSewerMHMaterialTypeGateway.GetMaterialType((int)materialId);
            }
            else
            {
                tbxMaterial.Text = "";
            }

            tbxLocation.Text = manholeRehabilitationManholeDetailsGateway.GetLocation(assetId);
            tbxConditioningRating.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetConditionRating(assetId).HasValue)
            {
                tbxConditioningRating.Text = manholeRehabilitationManholeDetailsGateway.GetConditionRating(assetId).ToString();
            }
        }