Example #1
0
        private void DeleteStockEventHandler(object sender, DeleteStockEventArgs e)
        {
            if (this.View.AskMessBox("您确定要删除当前选中库存么?") == 0)
            {
                for (int i = 0; i < e.StockID.Length; i++)
                {
                    StockModel stockModel = bllStock.GetModel(e.StockID[i]);
                    if (stockModel == null)
                    {
                        return;
                    }
                    StockListModel stockListModel = bllStockList.GetModelByStockID(stockModel.StockID);
                    if (stockListModel == null)
                    {
                        return;
                    }
                    ManageTaskListModel manaTaskList = bllTaskList.GetModelByStockListID(stockListModel.StockListID);
                    if (manaTaskList != null)
                    {
                        ManageTaskModel manaTask = bllTask.GetModel(manaTaskList.TaskID);
                        if (manaTask != null)
                        {
                            bllTask.Delete(manaTask.TaskID);
                        }
                    }

                    Hashtable updateGsStatusHs = bllGoodsSite.GetUpdateModelHs(EnumGSStoreStatus.空货位.ToString()
                                                                               , EnumGSRunStatus.待用.ToString(), EnumTaskCategory.出库.ToString(), stockModel.GoodsSiteID); //获取更新货位状态Hs
                    Hashtable        deleteStockHs = bllStock.GetDeleteModelHash(e.StockID[i]);
                    List <Hashtable> allHs         = new List <Hashtable>();
                    allHs.Add(updateGsStatusHs);
                    allHs.Add(deleteStockHs);

                    bool deleteStatus = ExecuteManyHashSqls(allHs);
                    if (deleteStatus == true)
                    {
                        if (this.mainPres != null)
                        {
                            this.mainPres.ShowLog(ECAMSModel.EnumLogCategory.管理层日志, EnumLogType.提示, "用户:"
                                                  + this.userNameStr + ",手动删除库存ID:" + e.StockID[i] + "库存名称:" + stockListModel.GoodsSiteName + "成功!");
                        }
                    }
                    else
                    {
                        if (this.mainPres != null)
                        {
                            this.mainPres.ShowLog(ECAMSModel.EnumLogCategory.管理层日志, EnumLogType.提示, "用户:"
                                                  + this.userNameStr + ",手动删除库存ID:" + e.StockID[i] + "库存名称:" + stockListModel.GoodsSiteName + "失败!");
                        }
                    }
                }

                //List<StockListModel> modelList = bllStockList.GetModelList(queryHouseName,queryRowth,queryColumnth,queryLayerth, queryProductStasus, queryWorkFlowStatus);
                //this.View.RefreshDGVData(modelList);
                List <View_QueryStockListModel> modelList = bllQueryStockList.GetModelList(queryHouseName, queryRowth, queryColumnth, queryLayerth, queryProductStasus, queryWorkFlowStatus
                                                                                           , queryGsRunStatus, queryGsStoreStatus, queryGsTaskType, queryProductBatchNum);
                this.View.RefreshDGVData(modelList);
            }
        }
Example #2
0
        private void DeleteEventHandler(object sender, DeleteEventArgs e)
        {
            int deleteSure = this.View.AskMessBox("您确定要删除选中数据么?");

            if (deleteSure == 0)
            {
                switch (e.EnumDataList)
                {
                case EnumDataList.管理任务表:
                    for (int i = 0; i < e.ListID.Count(); i++)
                    {
                        bool deleteStatus = bllManaTask.Delete(e.ListID[i]);
                    }

                    DataSet dsManaTask = bllManaTask.GetAllList();
                    if (dsManaTask != null && dsManaTask.Tables.Count > 0)
                    {
                        DataTable dtManaTask = dsManaTask.Tables[0];
                        this.View.RefreshDataList(dtManaTask, e.EnumDataList);
                    }
                    break;

                case EnumDataList.控制接口表:
                    for (int i = 0; i < e.ListID.Count(); i++)
                    {
                        bool deleteStatus = bllControlInter.Delete(e.ListID[i]);
                    }

                    DataSet dsControlInter = bllControlInter.GetAllList();
                    if (dsControlInter != null && dsControlInter.Tables.Count > 0)
                    {
                        DataTable dtControlInter = dsControlInter.Tables[0];
                        this.View.RefreshDataList(dtControlInter, e.EnumDataList);
                    }

                    break;

                case EnumDataList.控制任务表:
                    for (int i = 0; i < e.ListID.Count(); i++)
                    {
                        bool deleteStatus = bllControlTask.Delete(e.ListID[i]);
                    }
                    DataSet dsControlTask = bllControlTask.GetAllList();
                    if (dsControlTask != null && dsControlTask.Tables.Count > 0)
                    {
                        DataTable dtControlTask = dsControlTask.Tables[0];
                        this.View.RefreshDataList(dtControlTask, e.EnumDataList);
                    }
                    break;

                case EnumDataList.库存列表:
                    for (int i = 0; i < e.ListID.Count(); i++)
                    {
                        bool deleteStatus = bllStockList.Delete(e.ListID[i]);
                    }
                    DataSet dsStockList = bllStockList.GetAllList();
                    if (dsStockList != null && dsStockList.Tables.Count > 0)
                    {
                        DataTable dtStockList = dsStockList.Tables[0];
                        this.View.RefreshDataList(dtStockList, e.EnumDataList);
                    }
                    break;

                default:
                    break;
                }
            }
        }