Пример #1
0
        private List <DeliveryNotice> GetDeliveryNotices(List <DynamicObject> dynObjects)
        {
            DeliveryNotice        notice  = null;
            List <DeliveryNotice> notices = null;

            if (dynObjects == null || dynObjects.Count() == 0)
            {
                return(null);
            }

            notices = new List <DeliveryNotice>();

            foreach (var item in dynObjects)
            {
                if (item != null)
                {
                    notice = new DeliveryNotice();

                    notice.FBillNo = SQLUtils.GetFieldValue(item, "FBillNo");
                    notice.DeliveryStreetAddress  = SQLUtils.GetFieldValue(item, "F_HS_DeliveryAddress");
                    notice.F_HS_DeliveryCity      = SQLUtils.GetFieldValue(item, "F_HS_DeliveryCity");
                    notice.F_HS_DeliveryProvinces = SQLUtils.GetFieldValue(item, "F_HS_DeliveryProvinces");
                    notice.F_HS_RecipientCountry  = SQLUtils.GetCountryNo(this.Context, item, "F_HS_RecipientCountry_Id");
                    notice.F_HS_PostCode          = SQLUtils.GetFieldValue(item, "F_HS_PostCode");

                    notices.Add(notice);
                }
            }

            return(notices);
        }
Пример #2
0
        public override List <K3SalOrderInfo> GetSelectedSalOrders(Context ctx)
        {
            List <K3SalOrderInfo> orders = null;
            K3SalOrderInfo        order  = null;

            List <string>           billNos = GetSelectedSalOrderNos();
            DynamicObjectCollection coll    = GetCollection(ctx, billNos);

            var groups = from o in coll
                         group o by o["FBillNo"] into g
                         select g;

            if (groups != null && groups.Count() > 0)
            {
                orders = new List <K3SalOrderInfo>();

                foreach (var group in groups)
                {
                    if (group != null && group.Count() > 0)
                    {
                        order                       = new K3SalOrderInfo();
                        order.FBillNo               = SQLUtils.GetFieldValue(group.ElementAt(0), "FBillNo");
                        order.FDocumentStatus       = SQLUtils.GetFieldValue(group.ElementAt(0), "FDOCUMENTSTATUS");
                        order.FCloseStatus          = SQLUtils.GetFieldValue(group.ElementAt(0), "FCLOSESTATUS");
                        order.FCancelStatus         = SQLUtils.GetFieldValue(group.ElementAt(0), "FCANCELSTATUS");
                        order.F_HS_PaymentStatus    = SQLUtils.GetFieldValue(group.ElementAt(0), "F_HS_PAYMENTSTATUS");
                        order.F_HS_B2CCustId        = SQLUtils.GetCustomerNo(ctx, group.ElementAt(0), "F_HS_B2CCustId");
                        order.F_HS_RecipientCountry = SQLUtils.GetCountryNo(ctx, group.ElementAt(0), "F_HS_RECIPIENTCOUNTRY");
                        order.FSettleCurrId         = SQLUtils.GetSettleCurrNo(ctx, group.ElementAt(0), "FSETTLECURRID");
                    }

                    orders.Add(order);
                }
            }
            return(orders);
        }