Пример #1
0
        private void frmUpdateSysUserInfo_Load(object sender, EventArgs e)
        {
            this.txtLoginId.Text = this._loginid;//加载登录id
            DataTable dt       = SysUserMgr.GetOneUser(this._loginid);
            DataTable dtDepart = DepartMgr.GetAllDepartment();

            this.cbxDepart.DataSource    = dtDepart;
            this.cbxDepart.DisplayMember = dtDepart.Columns[0].ToString();
            this.cbxDepart.ValueMember   = dtDepart.Columns[1].ToString();

            if (dt != null)
            {
                this.txtName.Text   = dt.Rows[0][2].ToString();
                this.cbxDepart.Text = DepartMgr.GetNameFromId(dt.Rows[0][3].ToString());
                this.txtTel.Text    = dt.Rows[0][4].ToString();
                this.txtEmail.Text  = dt.Rows[0][5].ToString();
            }



            if (this._isother)
            {
                this.txtOldPass.PasswordChar = new char();
                this.txtOldPass.Text         = SysUserMgr.GetPass(this._loginid);
                //自己不可更改自身所在部门,只有由其他人进行更改才行
                this.cbxDepart.Enabled = true;
            }
        }
Пример #2
0
        /// <summary>
        /// 领用资产
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnOK_Click(object sender, EventArgs e)
        {
            Borrow br = new Borrow();

            br.ID     = this.textSerialNO.Text;
            br.EqNo   = this.textEqNO.Text;
            br.EqName = this.textName.Text;
            DataTable Empdt = EmployeeMgr.GetAllName();
            DataTable Depdt = DepartMgr.GetAllDepartment();

            br.Department = this.name2ID(Depdt, this.textDepartment.Text, "departName");
            br.KeepPlace  = this.textKeepPlace.Text;
            br.Keeper     = this.name2ID(Empdt, this.textKeeper.Text, "name");
            br.BAgent     = this.name2ID(Empdt, _user, "name");
            br.Borrower   = this.cbxborrower.SelectedValue.ToString();
            br.BDate      = this.dtpBDate.Value;
            br.RDate      = this.dtpRDate.Value;
            br.bRemark    = this.textBorrowRemark.Text;
            bool flag;

            if (updata_flag)
            {
                flag = BoroowMgr.BUpdate(ID, br);
            }
            else
            {
                if (IsEqAvailable(this.textEqNO.Text))
                {
                    if (_power == "0" || _power == "1")
                    {
                        flag = BoroowMgr.AddWithoutVerify(br);
                    }
                    else
                    {
                        flag = BoroowMgr.Add(br);
                    }
                    flag = EqMgr.BorrowEq(br.EqNo);
                    if (flag)
                    {
                        untCommon.InfoMsg("出借成功。");
                    }
                    else
                    {
                        untCommon.InfoMsg("出借失败。");
                    }
                }
                else
                {
                    untCommon.InfoMsg("该资产状态已改变,无法修改该信息。");
                }
            }
            this.DialogResult = DialogResult.OK;
        }
Пример #3
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     if (view_only)
     {
         untCommon.InfoMsg("当前无法修改。");
     }
     else
     {
         Clear clear = new Clear();
         clear.ID     = this.textSerialNO.Text;
         clear.EqNo   = this.textEqNO.Text;
         clear.EqName = this.textName.Text;
         DataTable Empdt = EmployeeMgr.GetAllName();
         DataTable Depdt = DepartMgr.GetAllDepartment();
         clear.Department = this.name2ID(Depdt, this.textDepartment.Text, "departName");
         clear.KeepPlace  = this.textKeepPlace.Text;
         clear.Keeper     = this.name2ID(Empdt, this.textKeeper.Text, "name");
         clear.CType      = this.cbxClearType.Text;
         clear.CAgent     = this.name2ID(Empdt, _user, "name");
         clear.CDate      = this.dtpDate.Value;
         clear.Remark     = this.textRemark.Text;
         bool flag;
         if (updata_flag)
         {
             flag = ClearMgr.CUpdate(ID, clear);
             if (flag)
             {
                 untCommon.InfoMsg("修改成功。");
             }
             else
             {
                 untCommon.InfoMsg("修改失败。");
             }
         }
         else
         {
             if (IsEqAvailable(this.textEqNO.Text))
             {
                 if (_power == "0" || _power == "1")
                 {
                     flag = ClearMgr.AddWithoutVerify(clear);
                     untCommon.InfoMsg("注销成功。");
                 }
                 else
                 {
                     flag = ClearMgr.Add(clear);
                     untCommon.InfoMsg("注销成功待审核。");
                 }
                 flag = EqMgr.ClearEq(clear.EqNo);
                 if (!flag)
                 {
                     untCommon.InfoMsg("注销失败。");
                 }
             }
             else
             {
                 untCommon.InfoMsg("该资产状态已改变,无法修改该信息。");
             }
         }
         this.DialogResult = DialogResult.OK;
     }
 }
Пример #4
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;
            }
        }
Пример #5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            Fix fix = new Fix();

            fix.ID     = this.textSerialNO.Text;
            fix.EqNo   = this.textEqNO.Text;
            fix.EqName = this.textName.Text;
            DataTable Empdt = EmployeeMgr.GetAllName();
            DataTable Depdt = DepartMgr.GetAllDepartment();

            fix.Department = this.name2ID(Depdt, this.textDepartment.Text, "departName");
            fix.KeepPlace  = this.textKeepPlace.Text;
            fix.Keeper     = this.name2ID(Empdt, this.textKeeper.Text, "name");
            fix.Maintainer = this.cbxMaintainer.Text;
            fix.MAgent     = this.name2ID(Empdt, _user, "name");
            fix.MDate      = this.dtpMDate.Value;
            fix.RDate      = this.dtpRDate.Value;
            fix.mRemark    = this.textFixRemark.Text;
            bool flag;

            if (updata_flag)
            {
                flag = FixMgr.MUpdate(ID, fix);
                if (flag)
                {
                    untCommon.InfoMsg("修改成功。");
                }
                else
                {
                    untCommon.InfoMsg("修改失败。");
                }
            }
            else
            {
                if (IsEqAvailable(this.textEqNO.Text))
                {
                    if (_power == "0" || _power == "1")
                    {
                        flag = FixMgr.AddWithoutVerify(fix);
                    }
                    else
                    {
                        flag = FixMgr.Add(fix);
                    }
                    flag = EqMgr.FixEq(fix.EqNo);
                    if (flag)
                    {
                        untCommon.InfoMsg("送修成功。");
                    }
                    else
                    {
                        untCommon.InfoMsg("送修失败。");
                    }
                }
                else
                {
                    untCommon.InfoMsg("该资产状态已改变,无法修改该信息。");
                }
            }
            this.DialogResult = DialogResult.OK;
        }