/// <summary> /// 查询指定的年,月内的资产归还记录 /// </summary> private void GetInfoYearMonth() { if (this.txtYear.Text.Trim() == "") { untCommon.InfoMsg("请输入所要查询记录的年。"); return; } if (this.cbxMonth.Text.Trim() == "") { untCommon.InfoMsg("请输入所要查询记录的月。"); return; } try { int year = int.Parse(this.txtYear.Text); int month = int.Parse(this.cbxMonth.Text); DataTable dt = ReturnMgr.getInfoYearMonth(year, month); if (dt != null) { if (dt.Rows.Count == 0) { untCommon.InfoMsg("没有您所要查询的资产信息。"); } else { this.dbgReturnInfo.DataSource = dt; this.panel1.Visible = false; } } } catch (Exception) { untCommon.ErrorMsg("输入错误,年和月请输入数字。"); } }
/// <summary> /// 初始化资产归还表 /// </summary> private void initReturnInfo() { DataTable dt = ReturnMgr.GetAll(); if (dt != null) { dbgReturnInfo.DataSource = dt; } }
/// <summary> /// 根据领用人编号查询(模糊查询) /// </summary> private void GetInfoByBorrower2() { DataTable dt = ReturnMgr.GetInfoByBorrower2(int.Parse(this.tooltxtCondition.Text)); if (dt != null) { this.dbgReturnInfo.DataSource = dt; } }
/// <summary> /// 跟据资产编号查询(模糊查询) /// </summary> private void GetInfo2() { DataTable dt = ReturnMgr.GetInfoByEqno2(this.tooltxtCondition.Text); if (dt != null) { this.dbgReturnInfo.DataSource = dt; } }
/// <summary> /// 查询最近1年内的资产归还记录 /// </summary> private void GetInfoLastYear() { DataTable dt = ReturnMgr.getInfoLastYear(); if (dt != null) { if (dt.Rows.Count == 0) { untCommon.InfoMsg("没有您所要查询的资产信息。"); } else { this.dbgReturnInfo.DataSource = dt; } } }
/// <summary> /// 跟据领用人编号查询(精确查询) /// </summary> private void GetInfoByBorrower() { if (this.tooltxtCondition.Text.Trim() == "") { this.tooltxtCondition.Focus(); untCommon.InfoMsg("请输入所要查询的领用人工号。"); return; } DataTable dt = ReturnMgr.GetInfoByBorrower(int.Parse(this.tooltxtCondition.Text)); if (dt != null) { if (dt.Rows.Count == 0) { untCommon.InfoMsg("没有您所要查询的资产信息。"); } else { this.dbgReturnInfo.DataSource = dt; } } }
private void btnOK_Click(object sender, EventArgs e) { if (info != null) { } if (this.CheckInput()) { Returns re = new Returns(); re.EqNo = this.txtEqNo.Text; re.Count = int.Parse(this.txtcount.Text); re.Booker = this.txtbooker.Text; re.Date = this.dtpDate.Value.ToShortDateString(); re.Borrower = int.Parse(this.txtborrower.Text); if (ReturnMgr.Returns(re)) { untCommon.InfoMsg("你成功归还了所领用的资产。"); this.DialogResult = DialogResult.OK; } else { untCommon.InfoMsg("您归还资产失败。"); } } }