コード例 #1
0
 partial void DeleteRecyclerScanInfo(RecyclerScanInfo instance);
コード例 #2
0
 partial void InsertRecyclerScanInfo(RecyclerScanInfo instance);
コード例 #3
0
 partial void UpdateRecyclerScanInfo(RecyclerScanInfo instance);
コード例 #4
0
ファイル: Provider.cs プロジェクト: sujathkumar/iwms
        /// <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;
            }
        }