Beispiel #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.BindMark();
            SetKind();

            EquipmentInformation entity = new EquipmentInfoLogic().GetDataByID(this.id);

            using (DasherStation.common.SqlHelper oData = new DasherStation.common.SqlHelper())
            {
                try
                {
                    this.cbxKind.SelectedValue = oData.QueryForDateSet(string.Format(@"
                    select a.id from equmentKind a 
                    join equipmentName b on a.id = b.ekid
                    where b.id = {0}", entity.enId)).Tables[0].Rows[0][0].ToString();
                }
                catch
                {
                }
            }

            SetModel();
            setDepartment();
            setDocument();

            this.txtNo.Text             = entity.no;
            this.cbxName.SelectedValue  = entity.enId;
            this.cbxModel.SelectedValue = entity.emId;
            this.txtCount.Text          = entity.count.ToString();
            this.txtRMark.Text          = entity.registrationMark;
            this.dtpBegin.Value         = entity.beginUseTime.Value;
            if (entity.dId.HasValue)
            {
                this.cbxDId.SelectedValue = entity.dId;
            }
            this.txtPosition.Text     = entity.installationPosition;
            this.txtSumPower.Text     = entity.sumPower.ToString();
            this.txtAddMethod.Text    = entity.addMethod;
            this.txtPValue.Text       = entity.primaryValue.ToString();
            this.txtRemainsValue.Text = entity.remainsValue.ToString();
            this.txtDYear.Text        = entity.depreciationYear.ToString();
            this.txtFactoryNo.Text    = entity.factoryNo;
            if (entity.produceDate.HasValue)
            {
                this.dtpProduce.Value = entity.produceDate.Value;
            }
            this.txtWorkman.Text       = entity.workMan;
            this.txtContackman.Text    = entity.contactMan;
            this.txtContactMethod.Text = entity.contactMethod;
            this.txtZip.Text           = entity.postCode;
            this.txtProducer.Text      = entity.producer;
            if (entity.dId2.HasValue)
            {
                this.cbxDocument.SelectedValue = entity.dId2;
            }
            this.txtAdress.Text = entity.factoryAddress;
            if (entity.mark != null)
            {
                this.cbx_mark.SelectedValue = entity.mark;
            }
        }