private ViewPoolConfig GetPoolConfig(int PoolID, int PoolConfigID)
 {
     ViewPoolConfig pc = new ViewPoolConfig();
     PoolConfig poolConfig = null;
     if (PoolConfigID == 0) //this is a new setup for an existing pool
     {
         poolConfig = new PoolConfig();
         poolConfig.Description = "Recreational";
         poolConfig.PoolID = PoolID;
         poolConfig.UOMID = 1; //default to meters
     }
     else
     {
         poolConfig = BizMgr.GetPoolConfig(PoolConfigID);
     }
     pc.UOMs = base.GetUOMs(poolConfig.UOMID);
     pc.Description = poolConfig.Description;
     pc.LaneCount = poolConfig.LaneCount;
     pc.LaneLength = poolConfig.LaneLength;
     pc.LengthMajor = (int)poolConfig.GetLengthFloor();
     pc.LengthMinor = (int)poolConfig.GetLengthRemainder();
     pc.LengthDescription = poolConfig.LengthDescription;
     pc.LocationName = poolConfig.LocationName;
     pc.LocationID = poolConfig.LocationID;
     pc.PoolConfigID = poolConfig.PoolConfigID;
     pc.PoolDescription = poolConfig.PoolDescription;
     pc.PoolID = poolConfig.PoolID;
     pc.UOMID = poolConfig.UOMID;
     return pc;
 }
 public int SavePoolConfig(PoolConfig poolConfig, int SystemUserID)
 {
     //audit trail of create/edit
     if (poolConfig.PoolConfigID == 0)
     {
         poolConfig.CreatedByUserID = SystemUserID;
         poolConfig.CreatedDate = DateTime.Now;
     }
     else
     {
         PoolConfig pc = Ctx.PoolConfigManager.PoolConfigGet(poolConfig.PoolConfigID);
         poolConfig.CreatedByUserID = pc.CreatedByUserID;
         poolConfig.CreatedDate = pc.CreatedDate;
         poolConfig.ModifiedByUserID = SystemUserID;
         poolConfig.ModifiedDate = DateTime.Now;
     }
     return Ctx.PoolConfigManager.PoolConfigSave(poolConfig);
 }
        public ActionResult SavePoolConfig(ViewPoolConfig viewPoolConfig)
        {
            PoolConfig poolConfig = new PoolConfig();
            poolConfig.Description = viewPoolConfig.Description;
            poolConfig.LaneLength = BizMgr.GetLaneLength(viewPoolConfig.LengthMajor, viewPoolConfig.LengthMinor, viewPoolConfig.UOMID);
            poolConfig.PoolConfigID = viewPoolConfig.PoolConfigID;
            poolConfig.PoolID = viewPoolConfig.PoolID;
            poolConfig.LaneCount = viewPoolConfig.LaneCount;
            poolConfig.UOMID = viewPoolConfig.UOMID;
            poolConfig.PoolConfigID = BizMgr.SavePoolConfig(poolConfig, this.CurrentUser.SystemUserID);

            ViewBag.PoolConfigs = GetPoolConfigs(viewPoolConfig.LocationID);
            return PartialView("_PoolConfigs");
        }