Example #1
0
    private void BindEquInfo()
    {
        new ResResourceService();
        EquEquipmentTypeService equEquipmentTypeService = new EquEquipmentTypeService();
        EquEquipment            byId = this.equSer.GetById(this.id);

        this.lblEquCode.Text = byId.EquCode;
        this.lblEquName.Text = byId.EquName;
        EquEquipmentType byId2 = equEquipmentTypeService.GetById(byId.TypeId);

        if (byId2 != null)
        {
            this.lblEquTypeName.Text = byId2.Name;
        }
        if (byId.SupplierId.HasValue)
        {
            XPMBasicContactCorpService xPMBasicContactCorpService = new XPMBasicContactCorpService();
            XPMBasicContactCorp        byId3 = xPMBasicContactCorpService.GetById(byId.SupplierId.Value);
            if (byId3 != null)
            {
                this.lblCorpName.Text = byId3.CorpName;
            }
        }
        this.lblFactoryNumber.Text         = byId.FactoryNumber;
        this.lblFactoryDate.Text           = this.ConvertToString(byId.FactoryDate);
        this.lblPurchaseDate.Text          = this.ConvertToString(byId.PurchaseDate);
        this.lblDepreciationRate.Text      = byId.DepreciationRate.ToString("0.000");
        this.lblPeriodicVertification.Text = byId.PeriodicVertification;
        this.lblDurableYear.Text           = byId.DurableYear;
        this.lblPurchasePrice.Text         = byId.PurchasePrice.ToString("0.000");
        this.lblState.Text       = this.GetStateOrProperty("EquState", byId.State);
        this.lblEquProperty.Text = this.GetStateOrProperty("EquProperty", byId.EquProperty);
        this.lblReceiptNo.Text   = byId.ReceiptNo;
        if (equEquipmentTypeService.IsShip(byId.TypeId))
        {
            this.trShip.Style["Display"] = "Block";
            this.lblShipLength.Text      = byId.ShipLength;
            this.lblShipWidth.Text       = byId.ShipWidth;
            this.lblShipCapacity.Text    = byId.ShipCapaticy;
            EquShipTechnicalParasService equShipTechnicalParasService = new EquShipTechnicalParasService();
            System.Collections.Generic.IList <EquShipTechnicalParas> equShipTechParasByEquId = equShipTechnicalParasService.GetEquShipTechParasByEquId(this.id);
            if (equShipTechParasByEquId == null || equShipTechParasByEquId.Count <= 0)
            {
                goto IL_352;
            }
            if (equShipTechParasByEquId.Count == 1)
            {
                this.lblOtherShipInfo.Text = equShipTechParasByEquId.First <EquShipTechnicalParas>().OtherShipInfo;
            }
            int   num   = 0;
            Label label = null;
            using (System.Collections.Generic.IEnumerator <EquShipTechnicalParas> enumerator = equShipTechParasByEquId.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    EquShipTechnicalParas current = enumerator.Current;
                    if (num == 0)
                    {
                        this.lblOtherShipInfo.Text = string.Format("参数{0}:   {1}", (num + 1).ToString(), current.OtherShipInfo);
                        label = (this.plOtherShips.FindControl("lblOtherShipInfo") as Label);
                    }
                    else
                    {
                        Literal literal = new Literal();
                        literal.Text = "<br />";
                        this.plOtherShips.Controls.Add(literal);
                        Label label2 = new Label();
                        label2.ID   = label.ID + num.ToString();
                        label2.Text = string.Format("参数{0}:   {1}", num + 1, current.OtherShipInfo);
                        this.plOtherShips.Controls.Add(label2);
                    }
                    num++;
                }
                goto IL_352;
            }
        }
        this.trShip.Style["Display"] = "None";
IL_352:
        this.lblMiddleInspectDate.Text = this.ConvertToString(byId.MiddleInspectDate);
        this.lblYearInspectDate.Text   = this.ConvertToString(byId.YearInspectDate);
        this.lblOtherCredentials.Text  = byId.OtherCredentials;
        this.lblAnnex.Text             = FileView.FilesBind(1901, byId.Id);
        this.lblNotes.Text             = byId.Note;
    }
Example #2
0
 private void BindEquInfo()
 {
     if (this.action == "edit")
     {
         new ResResourceService();
         EquEquipment byId = this.equSer.GetById(this.id);
         this.txtEquipmentCode.Text = byId.EquCode;
         this.txtEquName.Text       = byId.EquName;
         this.hfldEquTypeId.Value   = byId.TypeId;
         EquEquipmentType byId2 = this.typeService.GetById(byId.TypeId);
         if (byId2 != null)
         {
             this.txtEquTypeName.Value = byId2.Name;
         }
         this.ddlProperty.SelectedValue = byId.EquProperty.ToString();
         this.txtPurchasePrice.Text     = byId.PurchasePrice.ToString("0.000");
         this.txtDepreciationRate.Text  = string.Format("{0}%", byId.DepreciationRate.ToString("0.000"));
         this.txtPurchaseDate.Text      = (byId.PurchaseDate.HasValue ? byId.PurchaseDate.Value.ToString("yyyy-MM-dd") : string.Empty);
         this.txtDurableYear.Text       = byId.DurableYear;
         this.txtFactoryNumber.Text     = byId.FactoryNumber;
         this.ddlState.SelectedValue    = byId.State.ToString();
         if (byId.SupplierId.HasValue)
         {
             this.hfldCorpId.Value = byId.SupplierId.Value.ToString();
             XPMBasicContactCorpService xPMBasicContactCorpService = new XPMBasicContactCorpService();
             XPMBasicContactCorp        byId3 = xPMBasicContactCorpService.GetById(byId.SupplierId.Value);
             if (byId3 != null)
             {
                 this.txtCorpName.Value = byId3.CorpName;
             }
         }
         this.txtFactoryDate.Text           = (byId.FactoryDate.HasValue ? byId.FactoryDate.Value.ToString("yyyy-MM-dd") : string.Empty);
         this.txtPeriodicVertification.Text = byId.PeriodicVertification;
         this.txtReceiptNo.Text             = byId.ReceiptNo;
         if (this.typeService.IsShip(byId.TypeId))
         {
             this.txtShipLength.Text   = byId.ShipLength;
             this.txtShipWidth.Text    = byId.ShipWidth;
             this.txtShipCapacity.Text = byId.ShipCapaticy;
             EquShipTechnicalParasService equShipTechnicalParasService = new EquShipTechnicalParasService();
             System.Collections.Generic.IList <EquShipTechnicalParas> equShipTechParasByEquId = equShipTechnicalParasService.GetEquShipTechParasByEquId(this.id);
             if (equShipTechParasByEquId != null && equShipTechParasByEquId.Count > 0)
             {
                 foreach (EquShipTechnicalParas current in equShipTechParasByEquId)
                 {
                     if (!string.IsNullOrEmpty(this.hfldOtherShipsInfo.Value.Trim()))
                     {
                         HiddenField expr_2CB = this.hfldOtherShipsInfo;
                         expr_2CB.Value += "|";
                     }
                     HiddenField expr_2E6 = this.hfldOtherShipsInfo;
                     expr_2E6.Value += current.OtherShipInfo;
                 }
             }
         }
         this.txtMiddleInspectDate.Text = (byId.MiddleInspectDate.HasValue ? byId.MiddleInspectDate.Value.ToString("yyyy-MM-dd") : string.Empty);
         this.txtYearInspectDate.Text   = (byId.YearInspectDate.HasValue ? byId.YearInspectDate.Value.ToString("yyyy-MM-dd") : string.Empty);
         this.txtOtherCredentials.Text  = byId.OtherCredentials;
         this.txtNotes.Text             = byId.Note;
         this.SetShipInfoVisible();
     }
     else
     {
         this.id = System.Guid.NewGuid().ToString();
     }
     this.hdfEquId.Value = this.id;
 }