示例#1
0
        private void OnOutHouseByHand()
        {
            if (this.eventOutHouseByHand != null && this.dgv_StockQuery.CurrentRow != null)
            {
                long[] stockIDArr = new long[this.dgv_StockQuery.SelectedRows.Count];
                EnumProductStatus[] enumProductStatusArr = new EnumProductStatus[stockIDArr.Length];
                EnumGSRunStatus[]   gsRunStatusArr       = new EnumGSRunStatus[stockIDArr.Length];
                EnumGSStoreStatus[] gsStoreStatusArr     = new EnumGSStoreStatus[stockIDArr.Length];
                EnumTaskCategory[]  GSTaskTypeArr        = new EnumTaskCategory[stockIDArr.Length];

                for (int i = 0; i < this.dgv_StockQuery.SelectedRows.Count; i++)
                {
                    DataGridViewRow rowSelect = this.dgv_StockQuery.SelectedRows[i];// 从大到小
                    if (rowSelect != null)
                    {
                        long   stockID       = long.Parse(rowSelect.Cells["StockID"].Value.ToString());
                        string productStatus = rowSelect.Cells["ProductStatus"].Value.ToString();
                        string gsRunStatus   = rowSelect.Cells["gs_RunStatus"].Value.ToString();
                        string gsStoreStatus = rowSelect.Cells["gs_StoreStatus"].Value.ToString();
                        string gsTaskType    = rowSelect.Cells["gsTaskType"].Value.ToString();
                        if (stockID != 0 && productStatus != "")
                        {
                            stockIDArr[i]           = stockID;
                            enumProductStatusArr[i] = (EnumProductStatus)Enum.Parse(typeof(EnumProductStatus), productStatus);
                            gsRunStatusArr[i]       = (EnumGSRunStatus)Enum.Parse(typeof(EnumGSRunStatus), gsRunStatus);
                            gsStoreStatusArr[i]     = (EnumGSStoreStatus)Enum.Parse(typeof(EnumGSStoreStatus), gsStoreStatus);
                            GSTaskTypeArr[i]        = (EnumTaskCategory)Enum.Parse(typeof(EnumTaskCategory), gsTaskType);
                        }
                    }
                }

                StockEventArgs stockArgs = new StockEventArgs();
                stockArgs.ProductStatusArr = enumProductStatusArr;
                stockArgs.StockIDArr       = stockIDArr;
                stockArgs.GsRunStatusArr   = gsRunStatusArr;
                stockArgs.GsStoreStatusArr = gsStoreStatusArr;
                stockArgs.GSTaskTypeArr    = GSTaskTypeArr;

                this.eventOutHouseByHand.Invoke(this, stockArgs);
            }
            else
            {
                MessageBox.Show("请选择要出库的货位!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#2
0
        /// <summary>
        /// 判断系统是否存在未完成的任务类型
        /// </summary>
        /// <param name="taskName"></param>
        /// <param name="taskCat"></param>
        /// <param name="devCode"></param>
        /// <returns></returns>
        protected bool SysExistUnCompletedTask(EnumTaskName taskName, EnumTaskCategory taskCat, string devCode)
        {
            string strWhere = "InterfaceType='" + taskCat.ToString() + "' and DeviceCode='" + devCode + "'and InterfaceStatus='" +
                              EnumCtrlInterStatus.未生成.ToString() + "' ";
            List <ControlInterfaceModel> taskApplyList = ctlInterfaceBll.GetModelList(strWhere);

            strWhere = "TaskTypeName='" + taskName.ToString() + "' and TaskStatus<>'" + EnumTaskStatus.已完成.ToString() + "' and TaskStatus<>'" + EnumTaskStatus.任务撤销.ToString() + "' ";
            List <ControlTaskModel> existTaskList = ctlTaskBll.GetModelList(strWhere);

            if ((taskApplyList == null || taskApplyList.Count() < 1) && (existTaskList == null || existTaskList.Count() < 1))
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }