partial void DeleteRecyclerScanInfo(RecyclerScanInfo instance);
partial void InsertRecyclerScanInfo(RecyclerScanInfo instance);
partial void UpdateRecyclerScanInfo(RecyclerScanInfo instance);
/// <summary> /// InserRecyclerScan /// </summary> /// <param name="data"></param> /// <param name="scanInfoList"></param> /// <returns></returns> public int InserRecyclerScan(string recyclerId, string scanInfoList) { try { IList<RecyclerScanInfo> recyclerScanList = new List<RecyclerScanInfo>(); var recycler = context.Recyclers.Where(@w => @w.Id == Guid.Parse(recyclerId)).First(); string[] sep = { "," }; foreach (var scanInfo in scanInfoList.Split(sep, StringSplitOptions.RemoveEmptyEntries)) { RecyclerScanInfo recyclerScan = new RecyclerScanInfo { Id = Guid.NewGuid(), Tag = scanInfo.Trim(), RecyclerId = recycler.Id, CreateDateTime = DateTime.Now }; if (!recyclerScanList.Select(@s => @s.Tag).ToList().Contains(scanInfo.Trim())) { recyclerScanList.Add(recyclerScan); } } context.RecyclerScanInfos.InsertAllOnSubmit(recyclerScanList.AsEnumerable()); SubmitData(); return 217; } catch (Exception ex) { return 100; } }