コード例 #1
0
ファイル: Program.cs プロジェクト: dmziryanov/ApecAuto
        static List<OrderLineStatusResult> GetOrderStatuses( int[] orderids )
        {
            List<OrderLineStatusResult> result = new List<OrderLineStatusResult>();
            // Сопоставление сертификата (сертификат 'замаплен' на доменную учетку) и учетки на сайте
            string acctgId = ServiceAccountDac.GetClientIDByWcfServiceAccount( "RMS-AUTO\\murkin" );

            foreach (int id in orderids)
            {
                RmsAuto.Store.Entities.Order o = OrderBO.LoadOrderData( acctgId, id );
                var lines = o.OrderLines.ToList();//.AsQueryable().ToList();//.Where( OrderBO.TotalStatusExpression );
                foreach (var line in lines)
                {
                    OrderLineStatusResult l = new OrderLineStatusResult()
                    {
                        CurrentStatus = line.CurrentStatus,
                        Manufacturer = line.Manufacturer,
                        OrderID = line.OrderID,
                        PartNumber = line.PartNumber,
                        Qty = line.Qty,
                        ReferenceID = line.ReferenceID,
                        StrictlyThisBrand = false,
                        StrictlyThisNumber = line.StrictlyThisNumber,
                        StrictlyThisQty = false,
                        SupplierID = line.SupplierID,
                        UnitPrice = line.UnitPrice
                    };
                    result.Add( l );
                }
            }

            return result;
        }
コード例 #2
0
ファイル: FranchService.cs プロジェクト: dmziryanov/ApecAuto
        public List<OrderLineStatusResult> GetOrderStatuses(int[] orderids)
        {
            if (!Rights.Contains("2"))
            {
                //TODO: убрать Exception logger Logger.WriteError(CurrentIdentityName + ": " + "Access Denied", EventLogerID.BLException, EventLogerCategory.WebServiceError);
                throw new Exception("Access Denied");
            }

            List<OrderLineStatusResult> result = new List<OrderLineStatusResult>();
            // Сопоставление сертификата (сертификат 'замаплен' на доменную учетку) и учетки на сайте

            foreach (int id in orderids)
            {
                RmsAuto.Store.Entities.Order o = OrderBO.LoadOrderData( acctgId, id );
                var lines = o.OrderLines.ToList();
                foreach (var line in lines)
                {
                    OrderLineStatusResult l = new OrderLineStatusResult()
                    {
                        CurrentStatus = line.CurrentStatus,
                        Manufacturer = line.Manufacturer,
                        OrderID = line.OrderID,
                        PartNumber = line.PartNumber,
                        Qty = line.Qty,
                        ReferenceID = line.ReferenceID,
                        StrictlyThisBrand = false,
                        StrictlyThisNumber = line.StrictlyThisNumber,
                        StrictlyThisQty = false,
                        SupplierID = line.SupplierID,
                        UnitPrice = line.UnitPrice
                    };
                    result.Add( l );
                }
            }

            return result;
        }