//02/25/15 - comment for now
        //[HttpPost]
        //public ActionResult CreateUpdateOneFees(AUFeesRecord fees)
        //{


        //    var CurrentCustomer = _authenticationService.GetAuthenticatedCustomer();
        //    //session.CreatedBy = CurrentCustomer.Username;
        //    //session.UpdatedBy = CurrentCustomer.Username;

        //    //session.CreatedOnDT = System.DateTime.UtcNow;
        //    //session.UpdatedOnDT = System.DateTime.UtcNow;

        //    //var sale = _saleRepo.GetById(session.AUSaleID);
        //    //sale.AUSessionRecords.Add(session);
        //    //_saleRepo.Update(sale);
        //    SuccessNotification("Consignor Fees Updated!", false);
        //    return View("~/Views/AUConsignor/CreateUpdateOneFees.cshtml", fees);
        //}



        public ActionResult CreateUpdateConsignmentFinderFees(int ConsignmentId = 0, int FinderFeeId = 0)
        {

            AUCombConsignmentFinderFees consfees = new AUCombConsignmentFinderFees();

            if (ConsignmentId > 0)
            {
                //consfees.AUConsignmentRecord = _consignmentRepo.GetById(ConsignmentId);
                var consignment = _consignmentRepo.GetById(ConsignmentId);
                consfees.AUConsignmentID = consignment.AUConsignmentID;
                consfees.ConsignmentDesc = consignment.ConsignmentDesc;
                consfees.ConsignmentDate = consignment.ConsignmentDate;

            }
            else
            {
                throw new NopException("No ConsignmentId provided - please notify system aministrator");
            }



            //need to do this to make sure model is valid for ADD
            consfees.AUFinderFeesRecord = new AUFinderFeesRecord();
            consfees.AUFinderFeesRecord.AUFinderFeesID = 0; //set this because kick model invalid in POST otherwise

            
            //if (FinderFeeId > 0)
            //{
            //    consfees.AUFinderFeesRecord = _finderfeesRepo.GetById(FinderFeeId);
            //}

            return View("~/Views/AUConsignor/CreateUpdateConsignmentFinderFees.cshtml", consfees); //worked first time null
        }
        public ActionResult CreateUpdateConsignmentFinderFees(AUCombConsignmentFinderFees combfees)
        {
            if (ModelState.IsValid)
            {

                AUFinderFeesRecord fee = new AUFinderFeesRecord();
                //fee = _finderfeesRepo.GetById(combfees.AUFinderFeesRecord.AUFinderFeesID);

                //if (fee == null)
                //{
                    
                    fee.AUEntityID = combfees.AUConsignmentID;
                    fee.AUEntityType = "AUConsignment";
                    fee.CustomerID = combfees.AUFinderFeesRecord.CustomerID;
                    fee.DisplayOrder = 1;
                    fee.FinderFeeAmt = combfees.AUFinderFeesRecord.FinderFeeAmt;
                    fee.FinderFeePct = combfees.AUFinderFeesRecord.FinderFeePct;
                    _finderfeesRepo.Insert(fee);

                    
                    SuccessNotification("Finder Fee Created Successfully!");
                    return RedirectToRoute(new
                    {
                        Action = "CreateUpdateConsignment",
                        Controller = "AUConsignor",
                        //ConsignorId = r2.AUConsignorRecord.AUConsignorID,
                        ConsignmentId = combfees.AUConsignmentID
                    });
                //}
                //else
                //{

                //    throw new NopException("Finder Fee already exists! Please notify Administrator");

                //    //return View("~/Views/AUConsignor/CreateUpdateConsignmentFinderFees.cshtml", combfees); //not hit first time??
                //}
            }
            else
            {
                //invalid model will show "default" error messages driven by record annotation/decorations
                //var errors = ModelState.Values.SelectMany(v => v.Errors);
                ErrorNotification("Finder Fee Not Created - Model has errors! Please notify administrator.");
                return View("~/Views/AUConsignor/CreateUpdateConsignmentFinderFees.cshtml", combfees);
                //return View();
                //return View("~/Views/PromoSlider/CreateUpdatePromoSlider.cshtml"); //not hit first time?
                //return View("~/Plugins/Widgets.PromoSlider/Views/PromoSlider/CreateUpdatePromoSlider.cshtml");
            }
        }