Example #1
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod
        /// <summary>
        /// 获取库存列表
        /// </summary>
        /// <param name="houseName"></param>
        /// <param name="productStatus"></param>
        /// <param name="workFolwTime"></param>
        /// <returns></returns>
        public List <View_QueryStockListModel> GetModelList(string houseName, string rowth, string columnth, string layerth
                                                            , string productStatus, EnumWorkFolwStatus workFlowStatus, string gsRunStatus, string gsStoreStatus, string gsTaskType, string productBatchNum)
        {
            List <View_QueryStockListModel> modelList = null;
            string whereTaskType = "ProductStartStatus ='" + productStatus + "'";

            if (productStatus == "所有")
            {
                whereTaskType = "ProductStartStatus = '" + EnumProductStatus.B1库静置10天.ToString() + "'"
                                + " or ProductStartStatus ='" + EnumProductStatus.A1库静置10小时.ToString() + "'"
                                + " or ProductStartStatus = '" + EnumProductStatus.A1库老化3天.ToString() + "'";
            }
            List <TaskTypeModel> taskTypeList = bllTaskType.GetModelList(whereTaskType);

            if (taskTypeList != null && taskTypeList.Count > 0)
            {
                string dtNow        = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                int    workFlowTime = (int)taskTypeList[0].NeedTime;

                DataSet ds = dal.GetQueryList(houseName, rowth, columnth, layerth, productStatus, workFlowStatus.ToString(), workFlowTime
                                              , gsRunStatus, gsStoreStatus, gsTaskType, productBatchNum);
                modelList = DataTableToList(ds.Tables[0]);
            }
            return(modelList);
        }
Example #2
0
        private void OnQueryStock()
        {
            bool isRight = true;

            IsControlValueRight(ref isRight);
            if (this.eventQueryStock != null && isRight == true)
            {
                QueryStockEventArgs stockArgs      = new QueryStockEventArgs();
                EnumWorkFolwStatus  workFlowStatus = new EnumWorkFolwStatus();
                if (this.tscb_workFlowTime.SelectedItem.ToString() == EnumWorkFolwStatus.已达到.ToString())
                {
                    workFlowStatus = EnumWorkFolwStatus.已达到;
                }
                else if (this.tscb_workFlowTime.SelectedItem.ToString() == EnumWorkFolwStatus.未到达.ToString())
                {
                    workFlowStatus = EnumWorkFolwStatus.未到达;
                }
                else if (this.tscb_workFlowTime.SelectedItem.ToString() == EnumWorkFolwStatus.所有.ToString())
                {
                    workFlowStatus = EnumWorkFolwStatus.所有;
                }
                stockArgs.Rowth           = this.tscb_StockRow.Text;
                stockArgs.Columnth        = this.tscb_StockColumn.Text;
                stockArgs.Layerth         = this.tscb_StockLayer.Text;
                stockArgs.WorkFolwStatus  = workFlowStatus;
                stockArgs.StoreHouse      = this.tscb_StoreHouse.SelectedItem.ToString();
                stockArgs.ProductStatus   = this.tscb_ProductStatus.SelectedItem.ToString();
                stockArgs.GsRunStatus     = this.cb_QueryGSTaskStatus.SelectedItem.ToString().Trim();
                stockArgs.GsStoreStatus   = this.cb_QueryGSStoreType.SelectedItem.ToString().Trim();
                stockArgs.GsTaskType      = this.cb_QueryGSTaskType.SelectedItem.ToString().Trim();
                stockArgs.ProductBatchNum = this.cb_OutStorageBatchNum.Text;
                this.eventQueryStock.Invoke(this, stockArgs);
            }
        }
Example #3
0
        private void QueryStockEventHandler(object sender, QueryStockEventArgs e)
        {
            queryHouseName       = e.StoreHouse;
            queryProductStasus   = e.ProductStatus;
            queryWorkFlowStatus  = e.WorkFolwStatus;
            queryRowth           = e.Rowth;
            queryColumnth        = e.Columnth;
            queryLayerth         = e.Layerth;
            queryGsStoreStatus   = e.GsStoreStatus;
            queryGsRunStatus     = e.GsRunStatus;
            queryGsTaskType      = e.GsTaskType;
            queryProductBatchNum = e.ProductBatchNum;

            bool openProgress = this.View.OpenProgressBar();

            if (!openProgress)
            {
                return;
            }

            List <View_QueryStockListModel> modelList = bllQueryStockList.GetModelList(e.StoreHouse, e.Rowth, e.Columnth, e.Layerth, e.ProductStatus, e.WorkFolwStatus
                                                                                       , e.GsRunStatus, e.GsStoreStatus, e.GsTaskType, e.ProductBatchNum);

            this.View.SetExitButtonEnabled(false);
            this.View.RefreshDGVData(modelList);

            int allCoreNum = 0;

            for (int i = 0; i < modelList.Count; i++)
            {
                System.Threading.Thread.Sleep(0);
                this.View.FormDoEvent();
                List <View_StockListDetailModel> stockDetailModelList = bllView_StockDetail.GetStockDetailByGsID(modelList[i].GoodsSiteID);
                List <TB_Tray_indexModel>        trayDetailModelList  = new List <TB_Tray_indexModel>();
                if (stockDetailModelList != null)
                {
                    for (int j = 0; j < stockDetailModelList.Count; j++)
                    {
                        this.View.FormDoEvent();
                        System.Threading.Thread.Sleep(0);
                        TB_Tray_indexModel trayDetailModel = bllTrayDetail.GetModel(stockDetailModelList[j].TrayID);//查询料框电芯详细
                        if (trayDetailModel != null)
                        {
                            allCoreNum += (int)trayDetailModel.Tf_CellCount;
                        }
                    }
                }
            }
            this.View.ShowTrayCoreNum(allCoreNum.ToString());

            this.View.CloseProgressBar();
            this.View.SetExitButtonEnabled(true);
        }