/// <summary> /// 5.出库 /// </summary> private void ManagerCK() { bool bolState = false; try { KPS.Model.ChuKuInfo _Modelinfo = (KPS.Model.ChuKuInfo)_control.GetSaveData(); _Modelinfo.DataType = thisdeviceinfo.DeviceID; KPS.BLL.ChuKuManager chukumnager = new ChuKuManager(); if (ModelData != null) { _Modelinfo.ID = ((ChuKuInfo)ModelData).ID; bolState = chukumnager.Update(_Modelinfo); } else { bolState = chukumnager.Add(_Modelinfo); } } catch (Exception ex) { bolState = false; } ShowMsgStateInfo(bolState, ModelData); }
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 strSCCJName = txtSCCJ.Text.Trim(); //去除空格,生产厂家 string strGHDWName = txtGHDW.Text.Trim(); //去除空格,购货单位 string strWhereCondition = string.Format("(y_date>=#{0}# and y_date<=#{1}#)", strBeginTime, strEndTime); if (thisdevice != null && !string.IsNullOrEmpty(thisdevice.DeviceType)) { strWhereCondition = strWhereCondition + string.Format(" and DataType={0}", thisdevice.DeviceID); } if (!string.IsNullOrEmpty(strSCCJName)) { strWhereCondition = strWhereCondition + string.Format(" and y_sccj like '%{0}%'", strSCCJName); } if (!string.IsNullOrEmpty(strGHDWName)) { strWhereCondition = strWhereCondition + string.Format(" and y_ghdw like '%{0}%'", strGHDWName); } if (!string.IsNullOrEmpty(strProductName)) { strWhereCondition = strWhereCondition + string.Format(" and y_pm like '%{0}%'", strProductName); } ChuKuManager manager = new ChuKuManager(); try { List <ChuKuInfo> listData = manager.GetModelList(strWhereCondition); if (ListLoadingEvent != null) { ListLoadingEvent(listData, true, "获取记录列表成功!"); } } catch (Exception ex) { if (ListLoadingEvent != null) { ListLoadingEvent(null, false, ex.Message); } } }