コード例 #1
0
ファイル: EntryForm.cs プロジェクト: qq5013/StockControl_KPS
        /// <summary>
        /// 9.质量跟踪
        /// </summary>
        private void ManagerZLGZ()
        {
            bool bolState = false;
            try
            {
                KPS.Model.ProcessLoggingInfo _Modelinfo = (KPS.Model.ProcessLoggingInfo)_control.GetSaveData();
                _Modelinfo.DataType = thisdeviceinfo.DeviceID;

                KPS.BLL.ProcessLoggingManager plmanager = new ProcessLoggingManager();
                if (ModelData != null)
                {
                    _Modelinfo.ProcessID = ((ProcessLoggingInfo)ModelData).ProcessID;
                    bolState = plmanager.Update(_Modelinfo);
                }
                else
                {
                    bolState = plmanager.Add(_Modelinfo);
                }
            }
            catch (Exception ex)
            {
                bolState = false;
            }

            ShowMsgStateInfo(bolState, ModelData);
        }
コード例 #2
0
        /// <summary>
        /// 3.2.9.质量跟踪记录
        /// </summary>
        /// <param name="_list"></param>
        /// <param name="strTpeName">类型名称</param>
        private void DelZLGZ(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.ProcessLoggingInfo)
                    {
                        strIDList = strIDList + ((KPS.Model.ProcessLoggingInfo)_obj).ProcessID + ",";
                    }
                }
                if (strIDList.Contains(","))
                {
                    strIDList = strIDList.Substring(0, strIDList.Length - 1);
                }

                if (strIDList.Length > 0)
                {
                    KPS.BLL.ProcessLoggingManager manager = new BLL.ProcessLoggingManager();
                    if (manager.DeleteList(strIDList))
                    {
                        MessageBox.Show("删除成功!");
                        this.RecordListView.RemoveObjects(_list);
                    }
                    else
                    {
                        MessageBox.Show("删除失败!");
                    }
                }
            }
        }
コード例 #3
0
        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 strUserUnit = txtUserUnit.Text.Trim();//用户单位
            string strServiceName = txtServiceName.Text.Trim();//服务人员

            string strWhereCondition = string.Format("(ProcessDate>=#{0}# and ProcessDate<=#{1}#)", strBeginTime, strEndTime);

            if (thisdevice != null && !string.IsNullOrEmpty(thisdevice.DeviceType))
            {
                strWhereCondition = strWhereCondition + string.Format(" and DataType={0}", thisdevice.DeviceID);
            }
            if (!string.IsNullOrEmpty(strServiceName))
            {
                strWhereCondition = strWhereCondition + string.Format(" and ProcessServiceUser like '%{0}%'", strServiceName);
            }
            if (!string.IsNullOrEmpty(strUserUnit))
            {
                strWhereCondition = strWhereCondition + string.Format(" and ProcessCustomerUnit like '%{0}%'", strUserUnit);
            }
            if (!string.IsNullOrEmpty(strProductName))
            {
                strWhereCondition = strWhereCondition + string.Format(" and ProcessProductName like '%{0}%'", strProductName);
            }

            ProcessLoggingManager manager = new ProcessLoggingManager();
            try
            {
                List<ProcessLoggingInfo> listData = manager.GetModelList(strWhereCondition);

                if (ListLoadingEvent != null)
                {
                    ListLoadingEvent(listData, true, "获取记录列表成功!");
                }
            }
            catch (Exception ex)
            {
                if (ListLoadingEvent != null)
                {
                    ListLoadingEvent(null,false,ex.Message);
                }
            }
        }