139 lines
3.7 KiB
C#
139 lines
3.7 KiB
C#
|
|
using System.Collections.Generic;
|
|||
|
|
public class MainDataModel
|
|||
|
|
{
|
|||
|
|
readonly ExcelData excelData;
|
|||
|
|
public MainDataModel(ExcelData e)
|
|||
|
|
{
|
|||
|
|
excelData = e;
|
|||
|
|
}
|
|||
|
|
public List<MainData> GetMainDataList()
|
|||
|
|
{
|
|||
|
|
return excelData.allMainData;
|
|||
|
|
}
|
|||
|
|
public string GetModuleName(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ModuleName;
|
|||
|
|
}
|
|||
|
|
public string GetModuleImagePath(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ModuleImagePath;
|
|||
|
|
}
|
|||
|
|
public string GetSubModuleName(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).SubModuleName;
|
|||
|
|
}
|
|||
|
|
public string GetTaskName(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).TaskName;
|
|||
|
|
}
|
|||
|
|
public string GetToolName(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ToolName;
|
|||
|
|
}
|
|||
|
|
public string GetSoundPath(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).SoundPath;
|
|||
|
|
}
|
|||
|
|
public string GetSoundText(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).SoundText;
|
|||
|
|
}
|
|||
|
|
public string GetClipPath(int value)
|
|||
|
|
{
|
|||
|
|
if (value != 0)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ClipPath.Split("/")[1];
|
|||
|
|
}
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
public string GetClipManager(int value)
|
|||
|
|
{
|
|||
|
|
if (value != 0)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ClipPath.Split("/")[0];
|
|||
|
|
}
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
public string GetModelShowPath(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ModelShowPath;
|
|||
|
|
}
|
|||
|
|
public string GetTip(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).TipSoundText;
|
|||
|
|
}
|
|||
|
|
public int GetImageGroup(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ImageGroup;
|
|||
|
|
}
|
|||
|
|
public string GetModelClickPath(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ModelClickPath;
|
|||
|
|
}
|
|||
|
|
public string GetMessageType(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).MessageType;
|
|||
|
|
}
|
|||
|
|
public string GetToolImagePath(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ToolImagePath;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ȡģ<C8A1><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>id
|
|||
|
|
/// </summary>
|
|||
|
|
public int GetMaxId(string value)
|
|||
|
|
{
|
|||
|
|
int max = 0;
|
|||
|
|
for (int i = 0; i < excelData.allMainData.Count; i++)
|
|||
|
|
{
|
|||
|
|
if (value == excelData.allMainData[i].ModuleName)
|
|||
|
|
{
|
|||
|
|
if (max < excelData.allMainData[i].id)
|
|||
|
|
{
|
|||
|
|
max = excelData.allMainData[i].id;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return max;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// <20><>ȡģ<C8A1><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сid
|
|||
|
|
/// </summary>
|
|||
|
|
public int GetMinId(string value)
|
|||
|
|
{
|
|||
|
|
List<int> list = new();
|
|||
|
|
for (int i = 0; i < excelData.allMainData.Count; i++)
|
|||
|
|
{
|
|||
|
|
if (value == excelData.allMainData[i].ModuleName)
|
|||
|
|
{
|
|||
|
|
list.Add(excelData.allMainData[i].id);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
int min = list[0];
|
|||
|
|
for (int i = 0; i < list.Count; i++)
|
|||
|
|
{
|
|||
|
|
if(min > list[i])
|
|||
|
|
{
|
|||
|
|
min = list[i];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return min;
|
|||
|
|
}
|
|||
|
|
public int GetQuestionGroup(int id)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(id).QuestionGroup;
|
|||
|
|
}
|
|||
|
|
public string GetTriggerType(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).TriggerType;
|
|||
|
|
}
|
|||
|
|
public string[] GetModeGroup(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ModeGroup.Split("|");
|
|||
|
|
}
|
|||
|
|
public int GetScoreMode(int value)
|
|||
|
|
{
|
|||
|
|
return excelData.GetMainData(value).ScoreModel;
|
|||
|
|
}
|
|||
|
|
}
|