コード例 #1
0
        internal async Task <JsonResult> BoxChange(Consolidation boxdata)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlCommand smd = new SqlCommand("consolidation_box_change", cn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output;
                smd.Parameters.AddWithValue("@slot_id", boxdata.SlotId);
                smd.Parameters.AddWithValue("@box_id", boxdata.BoxId);
                smd.Parameters.AddWithValue("@location_id", boxdata.LocationId);
                await smd.ExecuteNonQueryAsync().ConfigureAwait(false);

                string json = smd.Parameters["@jsonOutput"].Value.ToString();
                smd.Dispose();
                JArray arr = JArray.Parse(json);
                return(new JsonResult(arr));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
コード例 #2
0
        internal async Task <JsonResult> ScanBarcode(Consolidation scandata)
        {
            SqlConnection cn = null;

            try
            {
                cn = Connection.GetConnection();
                SqlCommand smd = new SqlCommand("consolidation_scan_barcode", cn)
                {
                    CommandType = CommandType.StoredProcedure
                };
                smd.Parameters.Add("@jsonOutput", SqlDbType.NVarChar, -1).Direction = ParameterDirection.Output;
                smd.Parameters.AddWithValue("@email_id", scandata.EmailId);
                smd.Parameters.AddWithValue("@barcode", scandata.Barcode);
                smd.Parameters.AddWithValue("@cage_id", scandata.CageId);
                smd.Parameters.AddWithValue("@location_id", scandata.LocationId);
                smd.Parameters.AddWithValue("@sorting_zone", scandata.SortingZone);
                await smd.ExecuteNonQueryAsync().ConfigureAwait(false);

                string json = smd.Parameters["@jsonOutput"].Value.ToString();
                smd.Dispose();
                JArray arr = JArray.Parse(json);
                return(new JsonResult(arr));
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Connection.CloseConnection(ref cn);
            }
        }
コード例 #3
0
 public async Task <JsonResult> BoxChange([FromBody] Consolidation boxdata)
 {
     try
     {
         return(await _consolidationLogic.BoxChange(boxdata).ConfigureAwait(false));
     }
     catch (Exception ee)
     {
         return(await _consolidationLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
     }
 }
コード例 #4
0
 public async Task <JsonResult> ScanSlot([FromBody] Consolidation slotdata)
 {
     try
     {
         return(await _consolidationLogic.ScanSlot(slotdata).ConfigureAwait(false));
     }
     catch (Exception ee)
     {
         return(await _consolidationLogic.SendRespose("False", ee.Message).ConfigureAwait(false));
     }
 }
コード例 #5
0
        void ProcessPackageFramework(PackageArchiveReader package, NuGetFramework framework)
        {
            if (!consolidations.TryGetValue(framework, out var consolidation))
            {
                consolidation = new Consolidation(framework);
                consolidations.Add(framework, consolidation);
            }

            foreach (var assemblyName in GetItems(package.GetFrameworkItems(), framework))
            {
                consolidation.FrameworkAssemblyReferences.Add(new FrameworkAssemblyReference(
                                                                  assemblyName,
                                                                  new [] { framework }));
            }

            package.CopyFiles(
                workPath,
                GetItems(package.GetLibItems(), framework),
                (sourceFile, targetPath, fileStream) => {
                var targetDirectory = Path.GetDirectoryName(targetPath);
                if (!consolidation.AssemblySearchPaths.Contains(targetDirectory))
                {
                    consolidation.AssemblySearchPaths.Add(targetDirectory);
                }

                Directory.CreateDirectory(targetDirectory);

                using (var targetStream = File.Open(
                           targetPath,
                           FileMode.Create,
                           FileAccess.Write))
                    fileStream.CopyTo(targetStream);

                consolidation.Assemblies.Add(targetPath);

                return(targetPath);
            },
                null,
                default);

            consolidation.AssemblySearchPaths.AddRange(package
                                                       .GetPackageDependencies()
                                                       .Where(d => d.TargetFramework == framework)
                                                       .SelectMany(d => d.Packages)
                                                       .Select(d => NuGetLocalRepoHelper.GetPackageAssemblySearchPath(
                                                                   d.Id,
                                                                   d.VersionRange,
                                                                   framework))
                                                       .Where(d => d != null));
        }
コード例 #6
0
        internal CacheSource ToCacheSource()
        {
            var cs = new CacheSource();

            cs.Type = Type;
            if (ConnectionId != 0)
            {
                cs.ConnectionId = ConnectionId;
            }

            if (IsWorksheetSource != null)
            {
                if (IsWorksheetSource.Value)
                {
                    cs.WorksheetSource = new WorksheetSource();
                    if ((WorksheetSourceReference != null) && (WorksheetSourceReference.Length > 0))
                    {
                        cs.WorksheetSource.Reference = WorksheetSourceReference;
                    }
                    if ((WorksheetSourceName != null) && (WorksheetSourceName.Length > 0))
                    {
                        cs.WorksheetSource.Name = WorksheetSourceName;
                    }
                    if ((WorksheetSourceSheet != null) && (WorksheetSourceSheet.Length > 0))
                    {
                        cs.WorksheetSource.Sheet = WorksheetSourceSheet;
                    }
                    if ((WorksheetSourceId != null) && (WorksheetSourceId.Length > 0))
                    {
                        cs.WorksheetSource.Id = WorksheetSourceId;
                    }
                }
                else
                {
                    cs.Consolidation = Consolidation.ToConsolidation();
                }
            }
            else
            {
                if (ExtensionList != null)
                {
                    cs.CacheSourceExtensionList = (CacheSourceExtensionList)ExtensionList.CloneNode(true);
                }
            }

            return(cs);
        }
コード例 #7
0
        internal void FromCacheSource(CacheSource cs)
        {
            SetAllNull();

            if (cs.Type != null)
            {
                Type = cs.Type.Value;
            }
            if (cs.ConnectionId != null)
            {
                ConnectionId = cs.ConnectionId.Value;
            }

            if (cs.WorksheetSource != null)
            {
                if (cs.WorksheetSource.Reference != null)
                {
                    WorksheetSourceReference = cs.WorksheetSource.Reference.Value;
                }
                if (cs.WorksheetSource.Name != null)
                {
                    WorksheetSourceName = cs.WorksheetSource.Name.Value;
                }
                if (cs.WorksheetSource.Sheet != null)
                {
                    WorksheetSourceSheet = cs.WorksheetSource.Sheet.Value;
                }
                if (cs.WorksheetSource.Id != null)
                {
                    WorksheetSourceId = cs.WorksheetSource.Id.Value;
                }
                IsWorksheetSource = true;
            }
            else if (cs.Consolidation != null)
            {
                Consolidation.FromConsolidation(cs.Consolidation);
                IsWorksheetSource = false;
            }
            else if (cs.CacheSourceExtensionList != null)
            {
                ExtensionList     = (CacheSourceExtensionList)cs.CacheSourceExtensionList.CloneNode(true);
                IsWorksheetSource = null;
            }
        }
コード例 #8
0
        internal Consolidation ToConsolidation()
        {
            Consolidation c = new Consolidation();

            if (this.AutoPage != true)
            {
                c.AutoPage = this.AutoPage;
            }

            if (this.Pages.Count > 0)
            {
                Page pg;
                c.Pages = new Pages()
                {
                    Count = (uint)this.Pages.Count
                };
                foreach (List <string> ls in this.Pages)
                {
                    pg = new Page()
                    {
                        Count = (uint)ls.Count
                    };
                    foreach (string s in ls)
                    {
                        pg.Append(new PageItem()
                        {
                            Name = s
                        });
                    }
                    c.Pages.Append(pg);
                }
            }

            c.RangeSets = new RangeSets()
            {
                Count = (uint)this.RangeSets.Count
            };
            foreach (SLRangeSet rs in this.RangeSets)
            {
                c.RangeSets.Append(rs.ToRangeSet());
            }

            return(c);
        }
コード例 #9
0
        internal void FromConsolidation(Consolidation c)
        {
            this.SetAllNull();

            if (c.AutoPage != null)
            {
                this.AutoPage = c.AutoPage.Value;
            }

            Page          pg;
            PageItem      pgi;
            List <string> listPage;
            SLRangeSet    rs;

            using (OpenXmlReader oxr = OpenXmlReader.Create(c))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Page))
                    {
                        listPage = new List <string>();
                        pg       = (Page)oxr.LoadCurrentElement();
                        using (OpenXmlReader oxrPage = OpenXmlReader.Create(pg))
                        {
                            while (oxrPage.Read())
                            {
                                if (oxrPage.ElementType == typeof(PageItem))
                                {
                                    pgi = (PageItem)oxrPage.LoadCurrentElement();
                                    listPage.Add(pgi.Name.Value);
                                }
                            }
                        }
                        this.Pages.Add(listPage);
                    }
                    else if (oxr.ElementType == typeof(RangeSet))
                    {
                        rs = new SLRangeSet();
                        rs.FromRangeSet((RangeSet)oxr.LoadCurrentElement());
                        this.RangeSets.Add(rs);
                    }
                }
            }
        }
コード例 #10
0
        internal Consolidation ToConsolidation()
        {
            var c = new Consolidation();

            if (AutoPage != true)
            {
                c.AutoPage = AutoPage;
            }

            if (Pages.Count > 0)
            {
                Page pg;
                c.Pages = new Pages {
                    Count = (uint)Pages.Count
                };
                foreach (var ls in Pages)
                {
                    pg = new Page {
                        Count = (uint)ls.Count
                    };
                    foreach (var s in ls)
                    {
                        pg.Append(new PageItem {
                            Name = s
                        });
                    }
                    c.Pages.Append(pg);
                }
            }

            c.RangeSets = new RangeSets {
                Count = (uint)RangeSets.Count
            };
            foreach (var rs in RangeSets)
            {
                c.RangeSets.Append(rs.ToRangeSet());
            }

            return(c);
        }
コード例 #11
0
        internal void FromConsolidation(Consolidation c)
        {
            this.SetAllNull();

            if (c.AutoPage != null) this.AutoPage = c.AutoPage.Value;

            Page pg;
            PageItem pgi;
            List<string> listPage;
            SLRangeSet rs;
            using (OpenXmlReader oxr = OpenXmlReader.Create(c))
            {
                while (oxr.Read())
                {
                    if (oxr.ElementType == typeof(Page))
                    {
                        listPage = new List<string>();
                        pg = (Page)oxr.LoadCurrentElement();
                        using (OpenXmlReader oxrPage = OpenXmlReader.Create(pg))
                        {
                            while (oxrPage.Read())
                            {
                                if (oxrPage.ElementType == typeof(PageItem))
                                {
                                    pgi = (PageItem)oxrPage.LoadCurrentElement();
                                    listPage.Add(pgi.Name.Value);
                                }
                            }
                        }
                        this.Pages.Add(listPage);
                    }
                    else if (oxr.ElementType == typeof(RangeSet))
                    {
                        rs = new SLRangeSet();
                        rs.FromRangeSet((RangeSet)oxr.LoadCurrentElement());
                        this.RangeSets.Add(rs);
                    }
                }
            }
        }
コード例 #12
0
        internal SLCacheSource Clone()
        {
            var cs = new SLCacheSource();

            cs.Type         = Type;
            cs.ConnectionId = ConnectionId;

            cs.IsWorksheetSource = IsWorksheetSource;

            cs.WorksheetSourceReference = WorksheetSourceReference;
            cs.WorksheetSourceName      = WorksheetSourceName;
            cs.WorksheetSourceSheet     = WorksheetSourceSheet;
            cs.WorksheetSourceId        = WorksheetSourceId;

            cs.Consolidation = Consolidation.Clone();

            if (ExtensionList != null)
            {
                cs.ExtensionList = (CacheSourceExtensionList)ExtensionList.CloneNode(true);
            }

            return(cs);
        }
コード例 #13
0
        internal Consolidation ToConsolidation()
        {
            Consolidation c = new Consolidation();
            if (this.AutoPage != true) c.AutoPage = this.AutoPage;

            if (this.Pages.Count > 0)
            {
                Page pg;
                c.Pages = new Pages() { Count = (uint)this.Pages.Count };
                foreach (List<string> ls in this.Pages)
                {
                    pg = new Page() { Count = (uint)ls.Count };
                    foreach (string s in ls)
                    {
                        pg.Append(new PageItem() { Name = s });
                    }
                    c.Pages.Append(pg);
                }
            }

            c.RangeSets = new RangeSets() { Count = (uint)this.RangeSets.Count };
            foreach (SLRangeSet rs in this.RangeSets)
            {
                c.RangeSets.Append(rs.ToRangeSet());
            }

            return c;
        }