/// <summary> /// ID查重 /// </summary> /// <returns></returns> private bool CheckIDIsrepeat() { if (tbx_PlanID.Text.Trim() != "") { deviceInfo device = new deviceInfo(); string Condition = tbx_PlanID.Text; string sql = "select * from PlanManagementInfoList where PlanID ='" + Condition + "'"; try { DataSet result = device.gettablebycondition(sql); //log_tabel log = new log_tabel(); //log.addrow("PlanID", tbx_PlanID.Text.Trim(), log_tabel.operatetype.equal, log_tabel.mark.normal); //int i = device.GetRecordCount(logs.PlanManagementInfoList, log); if (result.Tables[0] != null && result.Tables[0].Rows.Count > 0) { MessageBox.Show("预案编号重复 请重新录入!"); return(false); } } catch (Exception e) { throw e; } } return(true); }
/// <summary> /// 通过ID联想 /// </summary> /// <param name="Condition"></param> private void GetPersonInfoByID(string Condition) { deviceInfo device = new deviceInfo(); string sql = "select * from PersonnelInfoList where PersonID like '%" + Condition + "%'"; DataSet ds = device.gettablebycondition(sql); DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0 && dt != null) { PersonResult = dt; } else { MessageBox.Show("找不到符合条件的人员相关信息,请重新输入!"); } }
/// <summary> /// 通过姓名联想 /// </summary> /// <param name="Condition"></param> private void GetEquipInfoByName(string Condition) { deviceInfo device = new deviceInfo(); string sql = "select * from PlanManagementInfoList where PlanID like '%" + Condition + "%'"; DataSet ds = device.gettablebycondition(sql); DataTable dt = ds.Tables[0]; if (dt.Rows.Count > 0 && dt != null) { PlanResult = dt; } else { MessageBox.Show("找不到符合条件的相关信息,请重新输入!"); } }
private void bingdingPlan() { deviceInfo Plan = new deviceInfo(); string sql = "select * from PlanManagementInfoList"; DataSet ds = Plan.gettablebycondition(sql); if (ds != null) { DataTable dt = ds.Tables[0]; if (dt != null && dt.Rows.Count > 0) { //foreach (DataRow item in dt.Rows) //{ cbx_Plan.DataSource = dt; cbx_Plan.ValueMember = dt.Columns["PlanID"].ToString(); cbx_Plan.DisplayMember = dt.Columns["PlanContent"].ToString(); //} } } }