Inheritance: TransportationAddressBase
コード例 #1
0
ファイル: New.ascx.cs プロジェクト: Novthirteen/yfkey-scms
 protected void ODS_TransportationAddress_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
 {
     transportationAddress = (TransportationAddress)e.InputParameters[0];
     transportationAddress.Country = transportationAddress.Country.Trim();
     transportationAddress.Province = transportationAddress.Province.Trim();
     transportationAddress.City = transportationAddress.City.Trim();
     transportationAddress.District = transportationAddress.District.Trim();
     transportationAddress.Address = transportationAddress.Address.Trim();
 }
コード例 #2
0
 public virtual void DeleteTransportationAddress(TransportationAddress entity)
 {
     entityDao.DeleteTransportationAddress(entity);
 }
コード例 #3
0
 public virtual void UpdateTransportationAddress(TransportationAddress entity)
 {
     entityDao.UpdateTransportationAddress(entity);
 }
コード例 #4
0
 public void DeleteTransportationAddress(TransportationAddress transportationAddress)
 {
     TransportationAddressMgr.DeleteTransportationAddress(transportationAddress);
 }
コード例 #5
0
 public void UpdateTransportationAddress(TransportationAddress transportationAddress)
 {
     TransportationAddressMgr.UpdateTransportationAddress(transportationAddress);
 }
コード例 #6
0
 public void CreateTransportationAddress(TransportationAddress transportationAddress)
 {
     TransportationAddressMgr.CreateTransportationAddress(transportationAddress);
 }
コード例 #7
0
 public virtual void CreateTransportationAddress(TransportationAddress entity)
 {
     Create(entity);
 }
コード例 #8
0
        public TransportPriceListDetail GetLastestTransportPriceListDetail(TransportPriceList priceList, Item item, DateTime effectiveDate, Currency currency, Uom uom, string pricingMethod, TransportationAddress shipFrom, TransportationAddress shipTo, string priceListType, string billingMethod, string vehicleType, string transportMethod)
        {
            DetachedCriteria detachedCriteria = DetachedCriteria.For<TransportPriceListDetail>();
            detachedCriteria.Add(Expression.Eq("TransportPriceList.Code", priceList.Code));
            if (item != null )
            {
                detachedCriteria.Add(Expression.Eq("Item.Code", item.Code));
            }
            detachedCriteria.Add(Expression.Eq("Currency.Code", currency.Code));
            if (uom != null )
            {
                detachedCriteria.Add(Expression.Eq("Uom.Code", uom.Code));
            }
            detachedCriteria.Add(Expression.Le("StartDate", effectiveDate));
            detachedCriteria.Add(Expression.Or(Expression.Ge("EndDate", effectiveDate.Date), Expression.IsNull("EndDate")));

            if (pricingMethod != null && pricingMethod != string.Empty)
            {
                detachedCriteria.Add(Expression.Eq("PricingMethod", pricingMethod));
            }
            if (shipFrom != null)
            {
                detachedCriteria.Add(Expression.Eq("ShipFrom.Id", shipFrom.Id));
            }
            if (shipTo != null)
            {
                detachedCriteria.Add(Expression.Eq("ShipTo.Id", shipTo.Id));
            }

            if (billingMethod != null && billingMethod != string.Empty)
            {
                detachedCriteria.Add(Expression.Eq("BillingMethod", billingMethod));
            }

            if (vehicleType != null && vehicleType != string.Empty)
            {
                detachedCriteria.Add(Expression.Eq("VehicleType", vehicleType));
            }
            detachedCriteria.Add(Expression.Eq("Type", priceListType));

            if (transportMethod != null && transportMethod != string.Empty)
            {
                detachedCriteria.Add(Expression.Eq("TransportMethod", transportMethod));
            }

            detachedCriteria.AddOrder(Order.Desc("StartDate")); //��StartDate����ȡ���µļ۸�
            IList<TransportPriceListDetail> priceListDetailList = criteriaMgr.FindAll<TransportPriceListDetail>(detachedCriteria);
            if (priceListDetailList != null && priceListDetailList.Count > 0)
            {
                return priceListDetailList[0];
            }
            else
            {
                return null;
            }
        }
コード例 #9
0
 public TransportPriceListDetail GetLastestTransportPriceListDetail(TransportPriceList priceList, DateTime effectiveDate, Currency currency, string pricingMethod, TransportationAddress shipFrom, TransportationAddress shipTo, string priceListType, string vehicleType, string transportMethod)
 {
     return GetLastestTransportPriceListDetail(priceList, null, effectiveDate, currency, null, pricingMethod, shipFrom, shipTo, priceListType, null, vehicleType, transportMethod);
 }
コード例 #10
0
        public TransportPriceListDetail GetLastestLadderStereTransportPriceListDetail(TransportPriceList priceList, Item item, DateTime effectiveDate, Currency currency, Uom uom, string pricingMethod, TransportationAddress shipFrom, TransportationAddress shipTo, string priceListType, string billingMethod, string vehicleType,decimal qty)
        {
            TransportPriceListDetail priceListDetail = null;
            DetachedCriteria detachedCriteria = DetachedCriteria.For<TransportPriceListDetail>();
            detachedCriteria.Add(Expression.Eq("TransportPriceList.Code", priceList.Code));
            if (item != null)
            {
                detachedCriteria.Add(Expression.Eq("Item.Code", item.Code));
            }
            detachedCriteria.Add(Expression.Eq("Currency.Code", currency.Code));
            if (uom != null)
            {
                detachedCriteria.Add(Expression.Eq("Uom.Code", uom.Code));
            }
            detachedCriteria.Add(Expression.Le("StartDate", effectiveDate));
            detachedCriteria.Add(Expression.Or(Expression.Ge("EndDate", effectiveDate.Date), Expression.IsNull("EndDate")));

            if (pricingMethod != null && pricingMethod != string.Empty)
            {
                detachedCriteria.Add(Expression.Eq("PricingMethod", pricingMethod));
            }
            if (shipFrom != null)
            {
                detachedCriteria.Add(Expression.Eq("ShipFrom.Id", shipFrom.Id));
            }
            if (shipTo != null)
            {
                detachedCriteria.Add(Expression.Eq("ShipTo.Id", shipTo.Id));
            }

            if (billingMethod != null && billingMethod != string.Empty)
            {
                detachedCriteria.Add(Expression.Eq("BillingMethod", billingMethod));
            }

            if (vehicleType != null && vehicleType != string.Empty)
            {
                detachedCriteria.Add(Expression.Eq("VehicleType", vehicleType));
            }
            detachedCriteria.Add(Expression.Eq("Type", priceListType));
            detachedCriteria.Add(Expression.IsNotNull("StartQty"));
               // detachedCriteria.Add(Expression.IsNotNull("EndQty"));

            detachedCriteria.AddOrder(Order.Desc("StartDate")); //��StartDate����ȡ���µļ۸�
            IList<TransportPriceListDetail> priceListDetailList = criteriaMgr.FindAll<TransportPriceListDetail>(detachedCriteria);
            if (priceListDetailList != null && priceListDetailList.Count > 0)
            {
                priceListDetail = priceListDetailList.Where(p => p.StartQty.Value < qty && (p.EndQty == null || p.EndQty.Value >= qty)).FirstOrDefault();

                if (priceListDetail == null)
                {
                    priceListDetail = priceListDetailList.OrderBy(p => p.StartQty.Value).FirstOrDefault();
                }
            }
               return priceListDetail;
        }