Exemplo n.º 1
0
        public static int Add(CreateFileInfo entity)
        {
            int result;

            if (entity == null)
            {
                result = 0;
            }
            else
            {
                result = BizBase.dbo.InsertModel <CreateFileInfo>(entity);
            }
            return(result);
        }
Exemplo n.º 2
0
    public void AddFileInfo(CreateFileInfo _info)
    {
        for (int i = 0; i < groupList.Count; i++)
        {
            if (groupList[i].ParamName == _info.ParamName)
            {
                // 当参数的名字相同时,设置为数组
                groupList[i].ParamTypeToArray();
                // 添加值,会自动添加分隔符
                groupList[i].AddGroupValue(_info.ParamValue);
                return;
            }
        }

        groupList.Add(_info);
    }
Exemplo n.º 3
0
    public CreateLibrary(string _xlsxFilePath)
    {
        ReadXlsxFile readXlsx = new ReadXlsxFile();

        if (string.IsNullOrEmpty(_xlsxFilePath))
        {
            UnityEngine.Debug.LogError("Xlsx 文件路径为空,无法加载");
            return;
        }

        if (readXlsx.IsFileOpened(_xlsxFilePath))
        {
            UnityEngine.Debug.LogError("Xlsx 文件处在打开状态,请先关闭该文件");
            return;
        }

        if (!readXlsx.Load(_xlsxFilePath))
        {
            UnityEngine.Debug.LogError("Xlsx 文件读取失败,请检查文件是否存在");
            return;
        }

        fileName = Path.GetFileNameWithoutExtension(_xlsxFilePath);

        foreach (var item in readXlsx.ColTablesDataList)
        {
            int tempRow = readXlsx.ColTablesDataList[item.Key].Count;       // 横向
            int tempCol = readXlsx.ColTablesDataList[item.Key][0].Count;    // 纵向

            clientList.Add(item.Key, new List <CreateFileGroupLibrary>());
            serverList.Add(item.Key, new List <CreateFileGroupLibrary>());

            List <List <string> > tempRowDataList = readXlsx.ColTablesDataList[item.Key];
            for (int i = 4; i < tempCol; i++)
            {
                CreateFileGroupLibrary tempClientGroupLib = new CreateFileGroupLibrary();
                CreateFileGroupLibrary tempServerGroupLib = new CreateFileGroupLibrary();

                for (int j = 0; j < tempRow; j++)
                {
                    string tempParamName    = tempRowDataList[j][0];
                    string tempParamExplain = tempRowDataList[j][1];
                    string tempParamType    = tempRowDataList[j][2];
                    string tempParamState   = tempRowDataList[j][3];
                    string tempParamValue   = tempRowDataList[j][i];

                    if (tempParamState == "0")
                    {
                        continue;
                    }

                    CreateFileInfo tempInfo = new CreateFileInfo(tempParamName, tempParamExplain, tempParamType, tempParamState, tempParamValue);

                    if (tempParamState == "1")         // 服务器专用
                    {
                        tempServerGroupLib.AddFileInfo(tempInfo);
                    }
                    else if (tempParamState == "2")    // 客户端专用
                    {
                        tempClientGroupLib.AddFileInfo(tempInfo);
                    }
                    else if (tempParamState == "3")    // 服务器和客户端通用
                    {
                        tempServerGroupLib.AddFileInfo(tempInfo);
                        tempClientGroupLib.AddFileInfo(tempInfo);
                    }
                }

                clientList[item.Key].Add(tempClientGroupLib);
                serverList[item.Key].Add(tempServerGroupLib);
            }
        }
    }
Exemplo n.º 4
0
 public static bool Update(CreateFileInfo entity)
 {
     return(entity != null && BizBase.dbo.UpdateModel <CreateFileInfo>(entity));
 }