Esempio n. 1
0
    public static ParkingList GetBuldings()
    {
        ParkingList lst = new ParkingList();
        using (SqlConnection Conn = new SqlConnection("server=SURESHJALAJA-PC;database=Parking;uid=sa;password=suresh;"))
        {
            using (SqlCommand Cmd = new SqlCommand(Constants.Proc.USP_GET_BUILDINGS, Conn))
            {
                Cmd.CommandType = CommandType.StoredProcedure;
                Conn.Open();
                using (SqlDataReader dr = Cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        ParkingBO Obj = new ParkingBO();
                        Obj.BuildingId = Convert.ToInt32(dr["BuildingID"]);
                        Obj.BuildingName = Convert.ToString(dr["BuildingName"]);
                        lst.Add(Obj);
                    }

                }
            }
        }
        return lst;
    }
Esempio n. 2
0
    public static ParkingList GetParkingSlotsByLevelID(int levelID)
    {
        ParkingList lst = new ParkingList();
        using (SqlConnection Conn = new SqlConnection("server=SURESHJALAJA-PC;database=Parking;uid=sa;password=suresh;"))
        {
            using (SqlCommand Cmd = new SqlCommand(Constants.Proc.USP_GET_PARKINGSLOTSBYLEVELID, Conn))
            {
                Cmd.CommandType = CommandType.StoredProcedure;
                Cmd.Parameters.Add("@LevelID", SqlDbType.Int).Value = levelID;
                Conn.Open();
                using (SqlDataReader dr = Cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        ParkingBO Obj = new ParkingBO();
                        Obj.ParkingID = Convert.ToInt32(dr["ParkingID"]);
                        Obj.ParkingName = Convert.ToString(dr["ParkingName"]);
                        Obj.LevelID = Convert.ToInt32(dr["LevelID"]);
                        lst.Add(Obj);
                    }

                }
            }
        }
        return lst;
    }