Exemple #1
0
        /// <summary>
        /// 设置整列逻辑区域
        /// </summary>
        /// <param name="houseName"></param>
        /// <param name="colth"></param>
        /// <returns></returns>
        public bool SetSingleColArea(string houseName, int rowth, int stCol, int edCol, string logicAreaName)
        {
            string          reStr = "";
            StoreHouseModel house = bllStoreHouse.GetModelByName(houseName);

            if (null == house)
            {
                return(false);
            }
            StoreHouseLogicAreaModel logicArea = bllLogicArea.GetModelByName(logicAreaName);

            if (logicArea == null)
            {
                return(false);
            }
            for (int i = stCol; i <= edCol; i++)
            {
                bool status = bllGs.SetSingleColGsArea(house.StoreHouseID, logicArea.StoreHouseLogicAreaID, rowth, i);
                if (status == false)
                {
                    continue;
                }
                this.iStorageManage.AddGSOperRecord(houseName, new CellCoordModel(rowth, i, 1)
                                                    , EnumGSOperateType.库存区域设置, "手动单列库存区域设置:货位列" + i + "为:" + logicArea.StoreHouseAreaName, ref reStr);
            }
            RefreshPos(this.currHouseName, currRowth);
            return(true);
        }
Exemple #2
0
        /// <summary>
        /// 设置整行逻辑区域
        /// </summary>
        /// <param name="houseName"></param>
        /// <param name="layerth"></param>
        /// <returns></returns>
        public bool SetSingleLayerArea(string houseName, int rowth, int layerth, string logicAreaName)
        {
            string          reStr = "";
            StoreHouseModel house = bllStoreHouse.GetModelByName(houseName);

            if (null == house)
            {
                return(false);
            }
            StoreHouseLogicAreaModel logicArea = bllLogicArea.GetModelByName(logicAreaName);

            if (logicArea == null)
            {
                return(false);
            }
            bool status = bllGs.SetSingleLayerGsArea(house.StoreHouseID, logicArea.StoreHouseLogicAreaID, rowth, layerth);

            if (status == true)
            {
                this.iStorageManage.AddGSOperRecord(houseName, new CellCoordModel(rowth, 1, 1)
                                                    , EnumGSOperateType.库存区域设置, "手动单层库存区域设置:货位层" + layerth + "为:" + logicArea.StoreHouseAreaName, ref reStr);
                RefreshPos(this.currHouseName, currRowth);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #3
0
        /// <summary>
        /// 设置单个货位的逻辑区域
        /// </summary>
        /// <param name="houseName"></param>
        /// <param name="gsName"></param>
        /// <returns></returns>
        public bool SetSingleGsArea(string houseName, string gsName, string logicAreaName)
        {
            string          reStr = "";
            StoreHouseModel house = bllStoreHouse.GetModelByName(houseName);

            if (null == house)
            {
                return(false);
            }
            StoreHouseLogicAreaModel logicArea = bllLogicArea.GetModelByName(logicAreaName);

            if (logicArea == null)
            {
                return(false);
            }
            bool status = bllGs.SetSingleGsArea(house.StoreHouseID, logicArea.StoreHouseLogicAreaID, gsName);

            if (status == true)
            {
                string[] rcl = gsName.Split('-');
                this.iStorageManage.AddGSOperRecord(houseName, new CellCoordModel(int.Parse(rcl[0]), int.Parse(rcl[1]), int.Parse(rcl[2]))
                                                    , EnumGSOperateType.库存区域设置, "手动单货位库存区域设置:货位" + gsName + "为:" + logicArea.StoreHouseAreaName, ref reStr);
                RefreshPos(this.currHouseName, currRowth);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #4
0
        private void ShowAreaColor()
        {
            Dictionary <string, Color> areaColor = new Dictionary <string, Color>();

            foreach (KeyValuePair <long, Color> kv in this.areaColor)
            {
                long logicID = kv.Key;
                StoreHouseLogicAreaModel logicAreaModel = bllLogicArea.GetModel(logicID);
                if (logicAreaModel == null)
                {
                    continue;
                }
                areaColor[logicAreaModel.StoreHouseAreaName] = kv.Value;
            }
            this.view.ShowLogicAreaColor(areaColor);
        }
Exemple #5
0
        /// <summary>
        /// 设置整列逻辑区域
        /// </summary>
        /// <param name="houseName"></param>
        /// <param name="colth"></param>
        /// <returns></returns>
        public bool SetMulLayerMulColArea(string houseName, int rowth, int stCol, int edCol, int stLayer, int edLayer, string logicAreaName)
        {
            string          reStr = "";
            StoreHouseModel house = bllStoreHouse.GetModelByName(houseName);

            if (null == house)
            {
                return(false);
            }
            StoreHouseLogicAreaModel logicArea = bllLogicArea.GetModelByName(logicAreaName);

            if (logicArea == null)
            {
                return(false);
            }
            //for (int i = stCol; i <= edCol; i++)
            //{

            bool status = bllGs.SetMulLayerMulColGsArea(house.StoreHouseID, logicArea.StoreHouseLogicAreaID, rowth, stCol, edCol, stLayer, edLayer);

            if (status == false)
            {
                return(false);
            }
            //for (int layer = stLayer; layer <= edLayer;layer ++ )
            //{
            //    for(int col = stCol;col<=edCol;col++)
            //    {
            this.iStorageManage.AddGSOperRecord(houseName, new CellCoordModel(rowth, stCol, stLayer)
                                                , EnumGSOperateType.库存区域设置, "手动多层多列库存区域设置:起始列[" + stCol + "]终止列[" + edCol + "] 起始层[" + stLayer + "]"
                                                + "终止层[" + edLayer + "] 为->" + logicArea.StoreHouseAreaName, ref reStr);
            //    }
            //}


            //}
            RefreshPos(this.currHouseName, currRowth);
            return(true);
        }
        /*
         * /// <summary>
         * /// 分页获取数据列表
         * /// </summary>
         * public DataSet GetList(int PageSize,int PageIndex,string strWhere)
         * {
         *  SqlParameter[] parameters = {
         *          new SqlParameter("@tblName", SqlDbType.VarChar, 255),
         *          new SqlParameter("@fldName", SqlDbType.VarChar, 255),
         *          new SqlParameter("@PageSize", SqlDbType.Int),
         *          new SqlParameter("@PageIndex", SqlDbType.Int),
         *          new SqlParameter("@IsReCount", SqlDbType.Bit),
         *          new SqlParameter("@OrderType", SqlDbType.Bit),
         *          new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
         *          };
         *  parameters[0].Value = "View_GoodsSite";
         *  parameters[1].Value = "GoodsSite_Reserve";
         *  parameters[2].Value = PageSize;
         *  parameters[3].Value = PageIndex;
         *  parameters[4].Value = 0;
         *  parameters[5].Value = 0;
         *  parameters[6].Value = strWhere;
         *  return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
         * }*/

        #endregion  BasicMethod
        #region  ExtensionMethod
        public List <StoreHouseLogicAreaModel> GetHouseArea(long storeHouseID)
        {
            string sqlStr = "select distinct(StoreHouseLogicAreaID) ,StoreHouseAreaName ,StoreHouseAreaDesc from View_GoodsSite where StoreHouseID = " + storeHouseID;
            List <StoreHouseLogicAreaModel> houseAreaList = new List <StoreHouseLogicAreaModel>();

            DataSet ds = DbHelperSQL.Query(sqlStr);

            if (ds != null && ds.Tables.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    long   areaID                  = long.Parse(ds.Tables[0].Rows[i]["StoreHouseLogicAreaID"].ToString());
                    string houseAreaName           = ds.Tables[0].Rows[i]["StoreHouseAreaName"].ToString();
                    string storeHouseAreaDesc      = ds.Tables[0].Rows[i]["StoreHouseAreaDesc"].ToString();
                    StoreHouseLogicAreaModel sglam = new StoreHouseLogicAreaModel();
                    sglam.StoreHouseLogicAreaID = areaID;
                    sglam.StoreHouseAreaName    = houseAreaName;
                    sglam.StoreHouseAreaDesc    = storeHouseAreaDesc;
                    houseAreaList.Add(sglam);
                }
            }
            return(houseAreaList);
        }
Exemple #7
0
        public bool SetAreaColorCfg(string logicAreaName, Color color, ref string reStr)
        {
            StoreHouseLogicAreaModel logicArea = bllLogicArea.GetModelByName(logicAreaName);

            if (logicArea == null)
            {
                return(false);
            }
            if (this.areaColor.Keys.Contains(logicArea.StoreHouseLogicAreaID) == true)
            {
                foreach (Color col in this.areaColor.Values)
                {
                    if (col == color)
                    {
                        reStr = "已经存在相同库区颜色!";

                        return(false);
                    }
                }
            }
            this.areaColor[logicArea.StoreHouseLogicAreaID] = color;

            CtlDBAccess.BLL.SysCfgBll       sysCfgBll = new CtlDBAccess.BLL.SysCfgBll();
            CtlDBAccess.Model.SysCfgDBModel cfgModel  = sysCfgBll.GetModel(SysCfg.SysCfgModel.SysCfgFileName);
            XElement root = null;

            if (cfgModel == null)
            {
                reStr = "系统配置不存在!";
                return(false);
            }
            root = XElement.Parse(cfgModel.cfgFile);
            if (root == null)
            {
                reStr = "系统配置不存在!";
                return(false);
            }
            XElement houseAreaColorSet = root.Element("sysSet").Element("HouseAreaColorSet");

            if (houseAreaColorSet == null)
            {
                reStr = "系统逻辑库存颜色信息不存在!";
                return(false);
            }
            houseAreaColorSet.Elements().Remove();//移除所有节点
            foreach (KeyValuePair <long, Color> kv in this.areaColor)
            {
                long logicID = kv.Key;
                StoreHouseLogicAreaModel logicAreaModel = bllLogicArea.GetModel(logicID);
                if (logicAreaModel == null)
                {
                    continue;
                }
                string   rgb     = kv.Value.R + "," + kv.Value.G + "," + kv.Value.B;
                XElement element = new XElement("HouseArea", new XAttribute("houseAreaID", logicID), new XAttribute("areaName", logicAreaModel.StoreHouseAreaName));
                element.Value = rgb;
                houseAreaColorSet.Add(element);
            }
            if (cfgModel != null)
            {
                cfgModel.cfgFile = root.ToString();
                sysCfgBll.Update(cfgModel);
            }
            ShowAreaColor();
            RefreshPos(this.currHouseName, currRowth);
            return(true);
        }