private ViewPool GetPool(int PoolID, int LocationID) { ViewPool pc = new ViewPool(); Pool pool = null; PoolConfig poolConfig = new PoolConfig(); if (PoolID == 0) //this is a new pool { pool = new Pool(); poolConfig.Description = "Recreational"; poolConfig.UOMID = 1; //default to meters } else { pool = BizMgr.GetPool(PoolID); } pc.UOMs = base.GetUOMs(poolConfig.UOMID); pc.PoolDescription = pool.Description; 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 = LocationID; pc.PoolConfigID = poolConfig.PoolConfigID; pc.PoolDescription = poolConfig.PoolDescription; pc.PoolID = poolConfig.PoolID; pc.UOMID = poolConfig.UOMID; return pc; }
public ActionResult SavePool(ViewPool viewPool) { Pool pool = new Pool(); pool.Description = viewPool.PoolDescription; pool.LocationID = viewPool.LocationID; int PoolID = BizMgr.SavePool(pool, this.CurrentUser.SystemUserID); PoolConfig poolConfig = new PoolConfig(); poolConfig.Description = viewPool.Description; poolConfig.LaneLength = BizMgr.GetLaneLength(viewPool.LengthMajor, viewPool.LengthMinor, viewPool.UOMID); poolConfig.PoolConfigID = viewPool.PoolConfigID; poolConfig.PoolID = PoolID; poolConfig.LaneCount = viewPool.LaneCount; poolConfig.UOMID = viewPool.UOMID; poolConfig.PoolConfigID = BizMgr.SavePoolConfig(poolConfig, this.CurrentUser.SystemUserID); ViewBag.PoolConfigs = GetPoolConfigs(viewPool.LocationID); return PartialView("_PoolConfigs"); }