public ActionResult EditRate(int?scanRateId, ScanRate model)
        {
            if (ModelState.IsValid)
            {
                ScanRateEntity scanRate = scanRateId.HasValue
                                              ? new ScanRateEntity(scanRateId.Value)
                                              : new ScanRateEntity();

                scanRate.ScanType        = model.ScanType;
                scanRate.RatePerScan     = model.RatePerScan;
                scanRate.MinCountForRate = model.MinCountForRate;
                scanRate.MaxCountForRate = model.MaxCountForRate;
                scanRate.EffectiveDate   = model.EffectiveDate;
                scanRate.IsActive        = model.IsActive;

                // save the scan rate
                scanRate.Save();
            }
            else
            {
                Response.StatusCode             = 417;
                Response.TrySkipIisCustomErrors = true;
            }

            return((Request.IsAjaxRequest() || ControllerContext.IsChildAction)
                           ? (ActionResult)PartialView(model)
                           : View(model));
        }
        public ActionResult EditRate(int?scanRateId)
        {
            var scanRate = new ScanRate(scanRateId);

            return((Request.IsAjaxRequest() || ControllerContext.IsChildAction)
                           ? (ActionResult)PartialView(scanRate)
                           : View(scanRate));
        }
        void ReleaseDesignerOutlets()
        {
            if (ScanRate != null)
            {
                ScanRate.Dispose();
                ScanRate = null;
            }

            if (Vmin != null)
            {
                Vmin.Dispose();
                Vmin = null;
            }

            if (Vmax != null)
            {
                Vmax.Dispose();
                Vmax = null;
            }
        }