List比较与赋值

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");
                }
               }

相关文章

显卡天梯图2024最新版,显卡是电脑进行图形处理的重要设备,...
初始化电脑时出现问题怎么办,可以使用win系统的安装介质,连...
todesk远程开机怎么设置,两台电脑要在同一局域网内,然后需...
油猴谷歌插件怎么安装,可以通过谷歌应用商店进行安装,需要...
虚拟内存这个名词想必很多人都听说过,我们在使用电脑的时候...
win11本地账户怎么改名?win11很多操作都变了样,用户如果想要...