Пример #1
0
        /// <summary>
        /// 加载资产的资料;
        /// </summary>
        private void LoadEqInfo()
        {
            DataTable dt = EqMgr.GetOneEqInfo(this._eqno);

            if (dt != null)
            {
                this.textSerialNO.Text   = DateTime.Now.ToString("yyyyMMddHHmmss");
                this.textEqNO.Text       = dt.Rows[0]["EqNo"].ToString();
                this.textName.Text       = dt.Rows[0]["EqName"].ToString();
                this.textKeepPlace.Text  = dt.Rows[0]["KeepPlace"].ToString();
                this.textDepartment.Text = DepartMgr.GetNameFromId(dt.Rows[0]["Department"].ToString());
                this.textKeeper.Text     = dt.Rows[0]["EqKeeper"].ToString();
            }
        }
Пример #2
0
        /// <summary>
        /// 进入资产领用界面
        /// </summary>
        private bool IsEqAvailable(string eqno)
        {
            DataTable dt = EqMgr.GetOneEqInfo(eqno);

            if (dt != null)
            {
                string status = dt.Rows[0]["State"].ToString();
                if (status.Equals("入库"))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        /// <summary>
        /// 初始化资产信息表
        /// </summary>
        private void DataLoad()
        {
            DataTable dt = EqMgr.GetOneEqInfo(this.eqno);

            if (dt != null && dt.Rows.Count != 0)
            {
                this.txtEqNo.Text    = this.eqno;
                this.txtEqName.Text  = dt.Rows[0][1].ToString();
                this.txtEduNo.Text   = dt.Rows[0][2].ToString();
                this.txtAssetNo.Text = dt.Rows[0][3].ToString();
                this.cbxEqType.Text  = dt.Rows[0][4].ToString();
                this.txtGB.Text      = dt.Rows[0][5].ToString();
                this.cbxCampus.Text  = dt.Rows[0][28].ToString();
                DataTable Depdt = DepartMgr.GetAllDepartment();
                this.txtDepartment.Text = this.ID2name(Depdt, dt.Rows[0][26].ToString(), "id");
                //第8位是部门的id,这里不显示
                this.cbxKeepPlace.Text  = dt.Rows[0][29].ToString();
                this.cbxEqKeeper.Text   = dt.Rows[0][25].ToString();
                this.cbxPurchaser.Text  = dt.Rows[0][13].ToString();
                this.txtAgent.Text      = dt.Rows[0][14].ToString();
                this.cbxUnit.Text       = dt.Rows[0][7].ToString();
                this.cbxFunds.Text      = dt.Rows[0][32].ToString();
                this.cbxPriceType.Text  = dt.Rows[0][22].ToString();
                this.txtPrice.Text      = dt.Rows[0][23].ToString();
                this.txtUSDPrice.Text   = dt.Rows[0][24].ToString();
                this.txtBrand.Text      = dt.Rows[0][15].ToString();
                this.txtModel.Text      = dt.Rows[0][16].ToString();
                this.txtCountry.Text    = dt.Rows[0][17].ToString();
                this.txtMfrs.Text       = dt.Rows[0][18].ToString();
                this.txtProductNo.Text  = dt.Rows[0][19].ToString();
                this.txtSupplier.Text   = dt.Rows[0][21].ToString();
                this.cbxUsage.Text      = dt.Rows[0][6].ToString();
                this.cbxDirection.Text  = dt.Rows[0][8].ToString();
                this.cbxBuyWay.Text     = dt.Rows[0][9].ToString();
                this.cbxGetWay.Text     = dt.Rows[0][10].ToString();
                this.txtCN.Text         = dt.Rows[0][30].ToString();
                this.txtInvNo.Text      = dt.Rows[0][31].ToString();
                this.cbxRelicLv.Text    = dt.Rows[0][33].ToString();
                this.txtRegAuz.Text     = dt.Rows[0][34].ToString();
                this.txtPatNo.Text      = dt.Rows[0][36].ToString();
                this.txtApvNo.Text      = dt.Rows[0][37].ToString();
                this.txtMgtAgency.Text  = dt.Rows[0][38].ToString();
                this.cbxCarUse.Text     = dt.Rows[0][39].ToString();
                this.cbxCarBP.Text      = dt.Rows[0][40].ToString();
                this.txtLicNo.Text      = dt.Rows[0][41].ToString();
                this.txtDSPL.Text       = dt.Rows[0][42].ToString();
                this.txtEngNo.Text      = dt.Rows[0][43].ToString();
                this.cbxFormation.Text  = dt.Rows[0][44].ToString();
                this.txtArea.Text       = dt.Rows[0][45].ToString();
                this.cbxPR.Text         = dt.Rows[0][46].ToString();
                this.txtCertNo.Text     = dt.Rows[0][47].ToString();
                this.txtCertLim.Text    = dt.Rows[0][49].ToString();
                this.txtCertProve.Text  = dt.Rows[0][50].ToString();
                this.txtAddress.Text    = dt.Rows[0][51].ToString();
                this.cbxCertNature.Text = dt.Rows[0][52].ToString();
                this.txtTenuArea.Text   = dt.Rows[0][53].ToString();
                this.txtTenuPrice.Text  = dt.Rows[0][54].ToString();
                this.cbxStructure.Text  = dt.Rows[0][55].ToString();
                this.txtBelongTo.Text   = dt.Rows[0][56].ToString();
                //57是图片
                this.txtRemark.Text = dt.Rows[0][59].ToString();

                if (dt.Rows[0][11].ToString() != "")
                {
                    this.dtpGetDate.Value   = DateTime.Parse(dt.Rows[0][11].ToString());
                    this.dtpGetDate.Checked = true;
                }
                if (dt.Rows[0][12].ToString() != "")
                {
                    this.dtpAddDate.Value   = DateTime.Parse(dt.Rows[0][12].ToString());
                    this.dtpAddDate.Checked = true;
                }
                if (dt.Rows[0][20].ToString() != "")
                {
                    this.dtpBirthday.Value   = DateTime.Parse(dt.Rows[0][20].ToString());
                    this.dtpBirthday.Checked = true;
                }
                if (dt.Rows[0][27].ToString() != "")
                {
                    this.dtpSvcDate.Value   = DateTime.Parse(dt.Rows[0][27].ToString());
                    this.dtpSvcDate.Checked = true;
                }
                if (dt.Rows[0][35].ToString() != "")
                {
                    this.dtpRegTime.Value   = DateTime.Parse(dt.Rows[0][35].ToString());
                    this.dtpRegTime.Checked = true;
                }
                if (dt.Rows[0][48].ToString() != "")
                {
                    this.dtpIssueDate.Value   = DateTime.Parse(dt.Rows[0][48].ToString());
                    this.dtpIssueDate.Checked = true;
                }
            }

            DataTable    dtPhoto = EqMgr.GetPhoto(this.eqno);
            MemoryStream photoStream;

            if (dtPhoto != null)
            {
                if (!(dtPhoto.Rows[0][0] is DBNull))
                {
                    byte[] imageBytes = (byte[])(dtPhoto.Rows[0][0]);

                    if (imageBytes == null || imageBytes.Length == 0)
                    {
                        return;
                    }



                    photoStream = new MemoryStream(imageBytes, 0, imageBytes.Length);


                    this.pbPhoto.Image = Image.FromStream(photoStream);
                }
                else
                {
                    this.pbPhoto.Image = null;
                }
            }
            else
            {
                this.pbPhoto.Image = null;
            }
        }