1.String 012 = ViewBag.Data.012;
String 014 = ViewBag.Data.014;
string[] st012;
string[] str014;
if (ViewBag.Data.012 != null)
{
str012 = 012.Split(',');
for (int i = 0; i < str012.Length; i++)
{
var id = str012[i];
if (!(string.IsNullOrEmpty(id)))
{
var gcb = new MEMBER();
var mno = new MEMBER();
gcb = mno.Membermodel(id);
str012[i] = gcb.U_Name;
}
}
ViewBag.Data.012 = string.Join(",", str012);
}
2. body.ForEach(y =>
{
var BB = basic.FirstOrDefault(b=>b.BASIC01 ==y.GI002PB_003);
if (BB != null)
{
y.GI002PB_003 = BB.BASIC01;
}
});
3. List<BODY> body = new List<BODY>();
for (int i = 0; i < ViewBag.DataBody.Count; i++)
{
var 003 = ViewBag.DataBody[i].BASIC01;
body.Add(new BODY());
body[i].003 = 003;
}
4.List<string> gIBody= new List<string>();
for (int i = 0; i < GI002pbdatas.Count; i++)
{
var gI003 = GI002pbdatas[i].003;
gIBody.Add("");
gIBody[i] = 003;
}
5.判断重复
var hashset = new HashSet<string>();
foreach (var gI003 in gIBody)
{
if (!hashset.Add(gI003))
{
var ecbs = new ExecuteCallback();
ecbs.ReturnMessage = "新增: " + gI003 + " 有重複,請重新選擇!";
return Content(JsonConvert.SerializeObject(ecbs), "text/plain");
}
}