----------------标题
My一级标题
My二级标题
My三级标题
My四级标题
My 五级标题
My 六级标题
----------------列表
- -开头Red
- *开头Red
----------------链接和图片
image
----------------引用
五星红旗 中国
----------------粗体和斜体
中华人民共和国国歌 (合唱) - 中国人民解放军军乐团
起来
不愿做奴隶的人们
把我们的血肉
筑成我们新的长城
中华民族到了
最危险的时候
每个人被迫着
发出最后的吼声
----------------代码引用
单行
sampleTime = sampleTime.Date;//日期
//脚本执行入口
public string RunSelf()
{
StringBuilder log = new StringBuilder();
#region 请你对数据源分析的脚本写在这里
string sampleNo = string.Empty; // 样品编号
DateTime sampleTime = DateTime.Now; // 实验日期
string projectName = string.Empty; // 项目名称
string sampleParam = string.Empty; // 样品参数
string cellValue = string.Empty; // 值结果
string sampleType = "实验"; // 数据类型
int sampleIndex = 1; // 进样次数
string handlers = string.Empty; // 操作者实验人
string txtPage = string.Empty; // 文件内容
string content = string.Empty; // 采集区域
string[] contents; // 采集区域拆分为行
string[] cells; // 拆分列
lib.model.LimsDataItem item; // 采集的数据
string fileName = ds.LocalFileName; // 文件名称
int i, j, k; // 一些常用的变量
projectName= "酒度";
//项目固定为酒度,采集酒精度
//样品编号前面1_样品编号_平行样,
projectName = "酒度";
Area area = null;
AreaRow row = null;
sampleTime = DateTime.Now.Date;
string iValue = string.Empty;
bool isBegin = false;
var areas = lib.Files.ExcelHelper.LoadFileForArea(ds.LocalFileName);
area = areas[0];
if(areas.Count<=0)
{
throw new System.Exception("数据源文件中不存在数据");
}
for ( i= 0; i < area.Rows.Count; i++)
{
row = area.Rows[i];//列
iValue = row[0].Value;////行
if (string.IsNullOrWhiteSpace(iValue)||iValue.Contains("Ethanol") ||iValue.Contains("唯一样品ID"))
continue;
sampleNo = row[5].Value.Trim().Split('_')[1];
string sampleNo1 = sampleNo.Substring(sampleNo.Length - 1);
bool pd = int.TryParse(sampleNo1,out sampleIndex);//进样次数
sampleParam = row[6].Value;
if (!pd)
{
sampleIndex = 1;
}
else
{
sampleNo = sampleNo.Substring(0, sampleNo.LastIndexOf('-'));
}
rd.Lims原始数据.Add( new lib.model.LimsDataItem(sampleNo,sampleTime,projectName, "酒精度", sampleParam, sampleType, sampleIndex, ""));
}
----------------表格
编号 | 姓名 | 地址 |
---|---|---|
xm001 | 张三 | 重庆 |
xm002 | 李四 | 成都 |
xm003 | 文武 | 乐山 |
xm004 | 小明 | 北京 |