/// <summary> /// 3.2.1.删除诊断试剂购进记录删除 /// </summary> /// <param name="_list"></param> private void DelZDSJGJ(System.Collections.IList _list, string strTpeName) { if (new ConfirmFrm("确认删除", string.Format("您确定需要删除所选的 {0} 条【{1}】记录?", _list.Count, strTpeName), "是", "否", 3).ShowDialog() == DialogResult.OK) { string strIDList = ""; foreach (object _obj in _list) { if (_obj is KPS.Model.GouJinInfo) { strIDList = strIDList + ((KPS.Model.GouJinInfo)_obj).ID + ","; } } if (strIDList.Contains(",")) { strIDList = strIDList.Substring(0, strIDList.Length - 1); } if (strIDList.Length > 0) { KPS.BLL.GouJinManager gjmanager = new BLL.GouJinManager(); if (gjmanager.DeleteList(strIDList)) { MessageBox.Show("删除成功!"); this.RecordListView.RemoveObjects(_list); } else { MessageBox.Show("删除失败!"); } } } }
private void button1_Click(object sender, EventArgs e) { string strBeginTime = dateTimePicker1.Value.ToString("yyyy-MM-dd 00:00:00"); string strEndTime = dateTimePicker2.Value.ToString("yyyy-MM-dd 23:59:59"); string strProductName = txtProductName.Text.Trim();//去除空格,产品名称 string strGYSName = txtGYS.Text.Trim();//去除空格,供应商 string strSCSName = txtSCS.Text.Trim();//去除空格,生产/制造商 string strWhereCondition = string.Format("(p_date>=#{0}# and p_date<=#{1}#)",strBeginTime, strEndTime); if (thisdevice != null && !string.IsNullOrEmpty(thisdevice.DeviceType)) { strWhereCondition = strWhereCondition + string.Format(" and DataType={0}", thisdevice.DeviceID); } if (!string.IsNullOrEmpty(strSCSName)) { strWhereCondition = strWhereCondition + string.Format(" and p_zzs like '%{0}%'", strSCSName); } if (!string.IsNullOrEmpty(strGYSName)) { strWhereCondition = strWhereCondition + string.Format(" and p_gys like '%{0}%'", strGYSName); } if (!string.IsNullOrEmpty(strProductName)) { strWhereCondition = strWhereCondition + string.Format(" and p_cpmc like '%{0}%'", strProductName); } GouJinManager manager=new GouJinManager(); try { List<GouJinInfo> listData = manager.GetModelList(strWhereCondition); if (ListLoadingEvent != null) { ListLoadingEvent(listData, true, "获取记录列表成功!"); } } catch (Exception ex) { if (ListLoadingEvent != null) { ListLoadingEvent(null,false,ex.Message); } } }
/// <summary> /// 1.诊断试剂购进 /// </summary> private void ManagerZDSJGJ() { bool bolState = false; try { KPS.Model.GouJinInfo _Modelinfo = (KPS.Model.GouJinInfo)_control.GetSaveData(); _Modelinfo.DataType = thisdeviceinfo.DeviceID; KPS.BLL.GouJinManager gjmanager = new GouJinManager(); if (ModelData != null) { _Modelinfo.ID = ((GouJinInfo)ModelData).ID; bolState = gjmanager.Update(_Modelinfo); } else { bolState = gjmanager.Add(_Modelinfo); if (bolState) { //库存中新增购进记录 KPS.BLL.InventoryManager inventorymg = new InventoryManager(); inventorymg.Add(_Modelinfo); } } } catch (Exception ex) { bolState = false; } ShowMsgStateInfo(bolState, ModelData); }