using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DataLinkMesWork;
using System.Security.Cryptography;
//using SystemFramework;
namespace bizFacade
{
public class Buttons
{
///
///
///
///
///
public static string Createbuttons(DataTable dt)//相当于在该DIV内动态画table
{
StringBuilder sb = new StringBuilder();//动态分配长度
if (dt != null)
{
if (dt.Rows.Count > 0)
{
sb.Append("
");
for (int i = 0; i < dt.Rows.Count; i++)
{
//标签id
string id = "button_OPs" + dt.Rows[i]["工位号"].ToString();
//标签类型
string type = "button";
//标签样式
string style = "height:98%;width:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";
string style_td = "width:20%; height:35px";
//标签值
string value = dt.Rows[i]["工位号"].ToString();
//标签点击事件
string onclick = "QualityDataSelect(value)";
string bgc = "background-color: #CCCCCC";//默认按钮背景色
if (dt.Rows[i]["合格标志"].ToString() == "NOK")
{
bgc = "background-color: red";
}
else if (dt.Rows[i]["合格标志"].ToString() == "OK")
{
bgc = "background-color: green";
}
else
{
bgc = "background-color: #CCCCCC";
}
//对行按钮数进行处理,保证五个换行
if (i % 4 == 3)
{
sb.Append("
");
sb.Append("
\r\n
");
}
else
{
sb.Append("
");
}
}
sb.Append("
");
}
}
return sb.ToString();
}
public static string CreateNewbuttons(DataTable dt)//相当于在该DIV内动态画table
{
StringBuilder sb = new StringBuilder();//动态分配长度
if (dt != null)
{
if (dt.Rows.Count > 0)
{
sb.Append("
");
for (int i = 0; i < dt.Rows.Count; i++)
{
//标签id
string id = "button_OPs" + dt.Rows[i]["工位号"].ToString();
//标签类型
string type = "button";
//标签样式
string style = "height:98%;width:98%;font-family:微软雅黑;font-size:15px;border-color: #99CCFF";
string style_td = "width:15%; height:30px";
//标签值
string value = dt.Rows[i]["工位号"].ToString();
//标签点击事件
string onclick = "QualityDataSelect(value)";
string bgc = "background-color: #CCCCCC";//默认按钮背景色
if (dt.Rows[i]["合格标志"].ToString() == "NOK")
{
bgc = "background-color: red";
}
else if (dt.Rows[i]["合格标志"].ToString() == "OK")
{
bgc = "background-color: green";
}
else
{
bgc = "background-color: #CCCCCC";
}
//对行按钮数进行处理,保证五个换行
if (i % 5 == 4)
{
sb.Append("
");
sb.Append("
\r\n
");
}
else
{
sb.Append("
");
}
}
sb.Append("
");
}
}
return sb.ToString();
}
///
/// 物料原因模块按钮创建
///
///
///
public static string CreateMaterialsButtons(DataTable dt)
{
StringBuilder sb = new StringBuilder();
if (dt != null)
{
if (dt.Rows.Count > 0)
{
sb.Append("
");
for (int i = 0; i < dt.Rows.Count; i++)
{
string id = (string)dt.Rows[i]["id"];
string type = (string)dt.Rows[i]["type"];
string style = (string)dt.Rows[i]["style"];
string value = (string)dt.Rows[i]["零件名称"];
string onclick = (string)dt.Rows[i]["onclick"];
string bgc = "";//默认按钮背景色
sb.Append("
");
}
sb.Append("
");
}
}
return sb.ToString();
}
///
///
///
///
///
public static string Createbuttons_alert(DataTable dt)//相当于在该DIV内动态画table
{
StringBuilder sb = new StringBuilder();//动态分配长度
if (dt != null)
{
if (dt.Rows.Count > 0)
{
sb.Append("
");
for (int i = 0; i < dt.Rows.Count; i++)
{
//标签id
string id = "button_OPs" + dt.Rows[i]["工位号"].ToString();
//标签类型
string type = "button";
//标签样式
string style = "height:40px;line-height:35px;width:98%;font-family:'微软雅黑';font-size:15px;border-color:#99CCFF";
string style_td = "width:20%; height:35px";
//标签值
string value = dt.Rows[i]["工位号"].ToString();
//标签点击事件
string onclick = "QualityDataSelect_alert(value)";
string bgc = "background-color: #CCCCCC";//默认按钮背景色
if (dt.Rows[i]["合格标志"].ToString() == "NOK")
{
bgc = "background-color: red";
}
else if (dt.Rows[i]["合格标志"].ToString() == "OK")
{
bgc = "background-color: green";
}
else
{
bgc = "background-color: #CCCCCC";
}
//对行按钮数进行处理,保证五个换行
if (i % 4 == 3)
{
sb.Append("