示例#1
0
        public string Export()
        {
            var _strB = new StringBuilder();

            try {
                _strB.Append(cdrRow.Start.ToString(AppConstants.CdrDateFormat));
                _strB.Append(",");
                _strB.Append(cdrRow.Start.ToString(AppConstants.CdrTimeFormat));
                _strB.Append(",");
                _strB.Append(Duration.ToString());
                _strB.Append(",");
                _strB.Append(CountryCode.ToString());
                _strB.Append(",");
                _strB.Append(LocalNumber);
                _strB.Append(",");
                _strB.Append(CustomerRouteName);
                _strB.Append(",");
                _strB.Append(ANI);
                _strB.Append(",");
                _strB.Append(OrigEPId);
                _strB.Append(",");
                _strB.Append(CustomerPrice.ToString(AppConstants.CdrAmountFormat));
                _strB.Append(",");
                _strB.Append(TermEPId);
                _strB.Append(",");
                _strB.Append(CarrierCost.ToString(AppConstants.CdrAmountFormat));
                _strB.Append(",");
                _strB.Append(RetailPrice.ToString(AppConstants.CdrAmountFormat));
            }
            catch (Exception _ex) {
                TimokLogger.Instance.LogRbr(LogSeverity.Error, "Cdr.Export", string.Format("Exception:\r\n{0}", _ex));
            }
            return(_strB.ToString());
        }
示例#2
0
        public ActionResult DeleteConfirmed(int id)
        {
            RetailPrice retailPrice = db.GasPrices.Find(id);

            db.GasPrices.Remove(retailPrice);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
 public ActionResult Edit([Bind(Include = "ID,Date,US_Average,Year,Midwest_Average,Speedway_Average,BP_Average,Shell_Average")] RetailPrice retailPrice)
 {
     if (ModelState.IsValid)
     {
         db.Entry(retailPrice).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(retailPrice));
 }
示例#4
0
 /// <summary>
 /// 获取商品零售价格 有多个sku时 返回价格区间
 /// </summary>
 /// <returns></returns>
 public string GetRetailPriceText()
 {
     if (Skus != null && Skus.Any())
     {
         var min = Skus.Min(x => x.RetailPrice);
         var max = Skus.Max(x => x.RetailPrice);
         return(min.ToString("F2") + "-" + max.ToString("F2"));
     }
     return(RetailPrice.ToString("F2"));
 }
示例#5
0
        public ActionResult Create([Bind(Include = "ID,Date,US_Average,Midwest_Average,Speedway_Average,BP_Average,Shell_Average")] RetailPrice retailPrice)
        {
            if (ModelState.IsValid)
            {
                db.GasPrices.Add(retailPrice);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(retailPrice));
        }
示例#6
0
        // GET: GasPrice/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RetailPrice retailPrice = db.GasPrices.Find(id);

            if (retailPrice == null)
            {
                return(HttpNotFound());
            }
            return(View(retailPrice));
        }
示例#7
0
        public bool GasCreate(CreateGas model)
        {
            var entity =
                new RetailPrice
            {
                Date             = model.Date,
                US_Average       = model.US_Average,
                Speedway_Average = model.Speedway_Average,
                BP_Average       = model.BP_Average,
                Shell_Average    = model.Shell_Average
            };

            using (var ctx = new ApplicationDbContext())
            {
                ctx.GasPrices.Add(entity);

                return(ctx.SaveChanges() == 1);
            }
        }
示例#8
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(ItemKey.ToString()).Append(" ").Append(ItemName.ToString()).Append(" ").Append(BarCodeNum.ToString()).Append(" ").Append(RetailPrice.ToString()).Append(" ").Append(ThresholdNum.ToString()).Append(" ").Append(StockLevel.ToString()).Append(" ").Append(SuppliersKey.ToString());
            return(sb.ToString());
        }