public ActionResult DeleteBid(int id)
        {
            string errMsg = string.Empty;

            #region 验证参数
            if (id == 0)
            {
                errMsg = "竞价标的Id不能为空";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }
            #endregion

            IData_BidManageService data_BidManageService = BLLContainer.Resolve <IData_BidManageService>();
            if (data_BidManageService.GetCount(p => p.ID == id) == 0)
            {
                errMsg = "该竞价标的不存在";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }

            var data_BidManage = data_BidManageService.GetModels(p => p.ID == id).FirstOrDefault();

            if (!data_BidManageService.Delete(data_BidManage))
            {
                return(RedirectToAction("Index", "BidManage", new { errMsg = "更新数据库失败" }));
            }

            return(RedirectToAction("Index", "BidManage", new { errMsg = "删除成功" }));
        }
        public ActionResult UpdateBid(int id, int productType, string bidDate, string bidStartTime, string bidEndTime, Nullable <decimal> estimateAmount, Nullable <decimal> currentPriceLower, Nullable <decimal> currentPriceUpper, Nullable <int> bidCount, Nullable <decimal> amountMin, Nullable <int> bidManner)
        {
            string errMsg = string.Empty;

            #region 验证参数
            if (id == 0)
            {
                errMsg = "竞价标的Id不能为空";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }

            if (productType == 0)
            {
                errMsg = "产品类型不能为空";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }

            if (string.IsNullOrEmpty(bidDate))
            {
                errMsg = "竞价日期不能为空";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }

            if (string.IsNullOrEmpty(bidStartTime))
            {
                errMsg = "开始时间不能为空";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }

            if (string.IsNullOrEmpty(bidEndTime))
            {
                errMsg = "结束时间不能为空";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }
            #endregion

            IData_BidManageService data_BidManageService = BLLContainer.Resolve <IData_BidManageService>();
            if (data_BidManageService.GetCount(p => p.ID == id) == 0)
            {
                errMsg = "该竞价标的不存在";
                return(RedirectToAction("Index", "BidManage", new { errMsg = errMsg }));
            }

            var data_BidManage = data_BidManageService.GetModels(p => p.ID == id).FirstOrDefault();
            data_BidManage.ProductType       = productType;
            data_BidManage.BidDate           = Convert.ToDateTime(bidDate);
            data_BidManage.BidStartTime      = Convert.ToDateTime(bidDate + " " + bidStartTime);
            data_BidManage.BidEndTime        = Convert.ToDateTime(bidDate + " " + bidEndTime);
            data_BidManage.EstimateAmount    = estimateAmount;
            data_BidManage.CurrentPriceLower = currentPriceLower;
            data_BidManage.CurrentPriceUpper = currentPriceUpper;
            data_BidManage.BidCount          = bidCount;
            data_BidManage.AmountMin         = amountMin;
            data_BidManage.BidManner         = bidManner;

            if (!data_BidManageService.Update(data_BidManage))
            {
                return(RedirectToAction("Index", "BidManage", new { errMsg = "更新数据库失败" }));
            }

            return(RedirectToAction("Index", "BidManage", new { errMsg = "更新成功" }));
        }