Ejemplo n.º 1
0
 public CreateWaterReservoir(ReservoirSpec spec, string commander, string commandid)
 {
     Spec = spec;
     Commander = commander;
     CommandId = commandid;
 }
Ejemplo n.º 2
0
        public static bool CreateReservoir(this IRepository <IDbProperties> repository, ReservoirSpec spec)
        {
            var water     = spec;
            var dataTypes = new List <IDataTypes>
            {
                new DataTypes("@hostel", SqlDbType.NVarChar, 50, spec.HostelId, ParameterDirection.Input, false, false, ""),
                new DataTypes("@tag", SqlDbType.NVarChar, 50, water.Tag, ParameterDirection.Input, false, false, ""),
                new DataTypes("@height", SqlDbType.Int, 0, water.Height.ToString(), ParameterDirection.Input, false, false, ""),
                new DataTypes("@reservoir", SqlDbType.UniqueIdentifier, 0, string.Empty, ParameterDirection.Output, false, false, "@reservoir")
            };
            var repos = new DbProperties("CreateReservoir", dataTypes, string.Empty, true, "@reservoir");
            var x     = repository.Update(new[] { repos });

            if (x > 0 || !string.IsNullOrWhiteSpace(repos.Id))
            {
                spec.ReservoirId = repos.Id;
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
 public CreatedWaterReservoir(ReservoirSpec spec)
 {
     ReservoirSpec = spec;
 }