Exemplo n.º 1
0
 public WeDeliveryTemplate(string name, AssumeType assumer, ValuationType valuation,
                           params DeliveryFee[] topFees)
     : this(name, assumer, valuation)
 {
     TkDebug.AssertArgumentNull(topFees, "topFees", null);
     TopFees.AddRange(topFees);
 }
Exemplo n.º 2
0
 public WeDeliveryTemplate(string name, AssumeType assumer, ValuationType valuation,
     params DeliveryFee[] topFees)
     : this(name, assumer, valuation)
 {
     TkDebug.AssertArgumentNull(topFees, "topFees", null);
     TopFees.AddRange(topFees);
 }
Exemplo n.º 3
0
        /// <summary>
        ///  存入缓存
        /// </summary>
        /// <param name="type">缓存类型</param>
        /// <returns>返回结果</returns>
        public JsonResult SaveValuation(ValuationType type)
        {
            if (CheckSession() == false)
            {
                return(Json(ResultModelBase.CreateTimeoutModel(), JsonRequestBehavior.AllowGet));
            }
            if (CheckSessionID() == false)
            {
                return(Json(ResultModelBase.CreateLogoutModel(), JsonRequestBehavior.AllowGet));
            }

            ResultModelBase result = new ResultModelBase();

            try
            {
                switch (type)
                {
                case ValuationType.Equipment:
                    var equipments = GetValSession <ValEquipmentInfo>();
                    if (equipments != null)
                    {
                        this.valuationManager.SaveValEquipments(GetLoginUser().ID, equipments.Values.ToList());
                    }
                    break;

                case ValuationType.Spare:
                    var spares = GetValSession <ValSpareInfo>();
                    if (spares != null)
                    {
                        this.valuationManager.SaveValSpares(spares.Values.ToList());
                    }
                    break;

                case ValuationType.Consumable:
                    var consumables = GetValSession <ValConsumableInfo>();
                    if (consumables != null)
                    {
                        this.valuationManager.SaveValConsumables(consumables.Values.ToList());
                    }
                    break;

                case ValuationType.Component:
                case ValuationType.CTTube:
                    var components = GetValSession <ValComponentInfo>();
                    if (components != null)
                    {
                        this.valuationManager.SaveValComponents(components.Values.ToList());
                    }
                    break;
                }
                ClearValSession();
            }
            catch (Exception ex)
            {
                NLog.LogManager.GetCurrentClassLogger().Error(ex, ex.Message);
                result.SetFailed(ResultCodes.SystemError, ControlManager.GetSettingInfo().ErrorMessage);
            }
            return(JsonResult(result));
        }
Exemplo n.º 4
0
 private WeDeliveryTemplate(string name, AssumeType assumer, ValuationType valuation)
 {
     TkDebug.AssertArgumentNullOrEmpty(name, "name", null);
     Name = name;
     Assumer = assumer;
     Valuation = valuation;
     TopFees = new List<DeliveryFee>();
 }
Exemplo n.º 5
0
 private WeDeliveryTemplate(string name, AssumeType assumer, ValuationType valuation)
 {
     TkDebug.AssertArgumentNullOrEmpty(name, "name", null);
     Name      = name;
     Assumer   = assumer;
     Valuation = valuation;
     TopFees   = new List <DeliveryFee>();
 }
Exemplo n.º 6
0
        public SPYValuationDataPointAggregate GetByDate(DateTime date, ValuationType valType)
        {
            var result = new SPYValuationDataPointAggregate(valType);

            return(result);
        }
Exemplo n.º 7
0
 public SPYValuationDataPointAggregate(ValuationType type, SPYValuationDataPoint[] items = null, string ticker = "SPY")
 {
     _items      = items;
     Ticker      = ticker;
     MetricsType = type;
 }