예제 #1
0
        public void LoadData()
        {
            /*List<StoreHouseModel> houseModelList = bllStoreHouse.GetModelList("");
             * List<string> houseList = new List<string>();
             * if (houseModelList == null)
             * {
             *  return;
             * }
             * for (int i = 0; i < houseModelList.Count; i++)
             * {
             *  houseList.Add(houseModelList[i].StoreHouseName);
             * }
             * this.view.BindHouseData(houseList);*/
            XmlNodeList houseNodeList = xmlOper.GetNodesByName("StoreHouse");

            if (null == houseNodeList)
            {
                return;
            }

            List <string> houseList = new List <string>();

            for (int i = 0; i < houseNodeList.Count; i++)
            {
                XmlNode house = houseNodeList[i];
                foreach (XmlAttribute xmlAttri in house.Attributes)
                {
                    houseList.Add(xmlAttri.Value);
                }
            }
            this.view.BindHouseData(houseList);
        }
예제 #2
0
        private bool AnalysisData()
        {
            if (string.IsNullOrEmpty(this.DataSource))
            {
                return(false);
            }
            if (xmlOperater.LoadXmlContent(this.DataSource) == false)
            {
                return(false);
            }
            XmlNodeList nodeList = xmlOperater.GetNodesByName("Item");

            if (nodeList == null)
            {
                return(false);
            }
            for (int i = 0; i < nodeList.Count; i++)
            {
                XmlNode node = nodeList[i];
                if (node == null)
                {
                    continue;
                }
                XmlAttribute nameAttr = xmlOperater.GetProperCollection(node, "name");
                if (nameAttr == null)
                {
                    continue;
                }
                XmlAttribute typeAttr = xmlOperater.GetProperCollection(node, "type");
                if (typeAttr == null)
                {
                    continue;
                }
                XmlAttribute descAttr = xmlOperater.GetProperCollection(node, "desc");
                if (descAttr == null)
                {
                    continue;
                }
                XmlAttribute styleAttr = xmlOperater.GetProperCollection(node, "style");
                if (styleAttr == null)
                {
                    continue;
                }

                string   name   = nameAttr.Value;
                DATATYPE type   = (DATATYPE)Enum.Parse(typeof(DATATYPE), typeAttr.Value);
                string   desc   = descAttr.Value;
                STYLE    style  = (STYLE)Enum.Parse(typeof(STYLE), styleAttr.Value);
                IGrapTB  grapTb = null;
                if (CreateTbox(name, type, node.InnerXml, style, desc, i, ref grapTb) == false)
                {
                    continue;
                }
                this.textboxList.Add(grapTb);
            }
            return(true);
        }
예제 #3
0
        //public void ResgistShowUserProperty(Action<string> showUserProperty)
        //{
        //    this.wmsViewManager.ResgistShowUserProperty(showUserProperty);
        //}

        //public void ResgistShowRoleProperty(Action<string> showRoleProperty)
        //{
        //    this.wmsViewManager.ResgistShowRoleProperty(showRoleProperty);
        //}

        //public void ResgistShowAreaProperty(Action<string> showAreaProperty)
        //{
        //    this.wmsViewManager.ResgistShowAreaProperty(showAreaProperty);
        //}



        /// <summary>
        ///初始化货位
        /// </summary>
        /// <returns>初始化状态</returns>
        private bool IniGoodsSite(ref string reStr)
        {
            try
            {
                XmlNodeList houseList = xmlOper.GetNodesByName("StoreHouse");
                if (null == houseList)
                {
                    reStr = "获取库房名称失败!";
                    return(false);
                }
                for (int i = 0; i < houseList.Count; i++)
                {
                    XmlNode house     = houseList[i];
                    string  houseName = house.Attributes["name"].Value.ToString();
                    bool    rebuild   = bool.Parse(house.SelectSingleNode("ReBuild").InnerText);
                    if (rebuild == false)//不需要重新创建进行下一个库房
                    {
                        continue;
                    }
                    bllCell.DeleteAreaCells(houseName);
                    XmlNode     rowsNode    = house.SelectSingleNode("GSRows");
                    XmlNodeList rowNodeList = rowsNode.SelectNodes("GSRow");

                    foreach (XmlNode row in rowNodeList)
                    {
                        string rowIndex      = row.Attributes["Index"].Value.ToString();
                        string shelfType     = row.Attributes["ShelfType"].Value.ToString();
                        string cols          = row.Attributes["Cols"].Value.ToString();
                        string layers        = row.Attributes["Layers"].Value.ToString();
                        string houseDeviceID = house.Attributes["DeviceID"].Value.ToString();
                        string areaID        = house.Attributes["AreaID"].Value.ToString();
                        CreateRowCells(houseDeviceID, areaID, int.Parse(rowIndex), shelfType, int.Parse(cols), int.Parse(layers));
                    }
                    ClearInvalidGS(houseName);
                }

                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.StackTrace;
                return(false);
            }
        }