Пример #1
0
 public override void renderEntity()
 {
     if (this.entity == null)
     {
         return;
     }
     if (!string.IsNullOrWhiteSpace(this.entity.stage_id))
     {
         Stage stage = stageDao.queryById(this.entity.stage_id);
         this.comboBox_Project.SelectedItem = Utils.getSelectedProject(this.projectList, stage.project_id);
         this.comboBox_Stage.SelectedItem   = Utils.getSelectedStage(this.stageList, this.entity.stage_id);
     }
     this.textBox_BuildingNum.Text        = this.entity.building_num;
     this.dateTimePicker_FinishDate.Value = this.entity.finish_date;
     this.numericUpDown_FloorCount.Value  = this.entity.floor_count;
     BeFun.Model.Domain.Orientation ori = Utils.getOrientation(this.entity.orientation);
     this.checkBox_Ori_East.Checked    = ori.east;
     this.checkBox_Ori_South.Checked   = ori.south;
     this.checkBox_Ori_West.Checked    = ori.west;
     this.checkBox_Ori_North.Checked   = ori.north;
     this.checkBox_ReadyHouse.Checked  = this.entity.ready_house;
     this.richTextBox_Description.Text = this.entity.description;
 }
Пример #2
0
        public override void renderEntity()
        {
            if (this.entity == null)
            {
                this.entity = new Floorplan();
            }

            //project list
            string project_id = this.entity.project_id;

            if (string.IsNullOrWhiteSpace(project_id))
            {
                if (projectList.Count > 0)
                {
                    project_id = (string)this.comboBox_Project.SelectedValue;
                }
            }
            else
            {
                this.comboBox_Project.SelectedItem = Utils.getSelectedProject(this.projectList, project_id);
            }
            this.comboBox_Project_SelectedIndexChanged(null, null);
            //stage list
            string   building_id = this.entity.building_id;
            Building building    = null;
            string   stage_id    = null;

            if (!string.IsNullOrWhiteSpace(building_id))
            {
                building = this.buildingDao.queryById(building_id);
                stage_id = building.stage_id;
            }
            if (string.IsNullOrWhiteSpace(stage_id))
            {
                if (stageList != null && stageList.Count > 0)
                {
                    stage_id = (string)this.comboBox_Stage.SelectedValue;
                }
            }
            else
            {
                this.comboBox_Stage.SelectedItem = Utils.getSelectedStage(this.stageList, stage_id);
            }
            this.comboBox_Stage_SelectedIndexChanged(null, null);
            //building list
            if (string.IsNullOrWhiteSpace(building_id))
            {
                if (buildingList != null && buildingList.Count > 0)
                {
                    building_id = (string)this.comboBox_Building.SelectedValue;
                }
            }
            else
            {
                this.comboBox_Building.SelectedItem = Utils.getSelectedBuilding(this.buildingList, building_id);
            }

            this.textBox_PictureId.Text = this.entity.picture_id;
            if (!string.IsNullOrWhiteSpace(this.entity.picture_id))
            {
                this.picture = this.MediaDao.queryById(this.entity.picture_id);
                if (this.picture != null)
                {
                    this.renderPicture();
                }
            }
            this.textBox_SalePictureId.Text = this.entity.sale_picture_id;
            if (!string.IsNullOrWhiteSpace(this.entity.sale_picture_id))
            {
                this.salePicture = this.MediaDao.queryById(this.entity.sale_picture_id);
                if (this.salePicture != null)
                {
                    this.renderSalePicture();
                }
            }

            this.comboBox_Type.SelectedItem          = Utils.getSelected(this.typeList, this.entity.type);
            this.checkBox_IsSplit.Checked            = this.entity.is_split;
            this.checkBox_IsStudio.Checked           = this.entity.is_studio;
            this.numericUpDown_BathRoom.Value        = this.entity.bathroom_count;
            this.numericUpDown_BedRoom.Value         = this.entity.bedroom_count;
            this.numericUpDown_CourtYard.Value       = this.entity.courtyard_count;
            this.numericUpDown_ExternalSize.Value    = (decimal)this.entity.external_size;
            this.numericUpDown_InternalSize.Value    = (decimal)this.entity.internal_size;
            this.numericUpDown_StudyRoom.Value       = this.entity.studyroom_count;
            this.numericUpDown_TotalSize.Value       = (decimal)this.entity.total_size;
            this.numericUpDown_LandSize.Value        = (decimal)this.entity.land_size;
            this.numericUpDown_OpenBalcony.Value     = this.entity.open_baclony_count;
            this.numericUpDown_EnclosedBalcony.Value = this.entity.enclosed_baclony_count;
            BeFun.Model.Domain.Orientation ori = Utils.getOrientation(this.entity.orientation);
            this.checkBox_Ori_East.Checked    = ori.east;
            this.checkBox_Ori_South.Checked   = ori.south;
            this.checkBox_Ori_West.Checked    = ori.west;
            this.checkBox_Ori_North.Checked   = ori.north;
            this.richTextBox_Description.Text = this.entity.description;
            if (!string.IsNullOrWhiteSpace(this.entity.id))
            {
                this.richTextBox_Apartments.ReadOnly = true;
            }
        }