Esempio n. 1
0
        public List <Employee> GetEmployee(Employee objEntity)
        {
            MySqlDatabaseFactory db         = new MySqlDatabaseFactory();
            Parameters           parameters = new Parameters();
            MySqlDataReader      reader     = null;
            MySqlConnection      conn       = db.GetDatabaseConnection();

            try
            {
                DataTable dt = new DataTable();
                parameters.Add("p_associateid", objEntity.associateid, ParameterDirection.Input);
                parameters.Add("p_associateno", objEntity.associateno, ParameterDirection.Input);
                parameters.Add("p_departmentid", objEntity.departmentid, ParameterDirection.Input);
                parameters.Add("p_departmentname", objEntity.departmentname, ParameterDirection.Input);
                parameters.Add("p_name", objEntity.name, ParameterDirection.Input);
                parameters.Add("p_isactive", objEntity.isactive, ParameterDirection.Input);
                using (reader = db.GetReader(conn, CommandType.StoredProcedure, Constants.StoredProcedures.ussp_associate, parameters))
                {
                    dt = db.Load(reader, true);
                }
                return(CommonUtility.ToList <Employee>(dt));
            }
            catch (MySqlException odbcEx)
            {
                throw odbcEx;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally { db.CloseConnection(conn); }
        }
Esempio n. 2
0
        public List <user> GetUsers(user obj)
        {
            MySqlDatabaseFactory db         = new MySqlDatabaseFactory();
            Parameters           parameters = new Parameters();
            MySqlDataReader      reader     = null;
            MySqlConnection      conn       = db.GetDatabaseConnection();

            try
            {
                DataTable dt = new DataTable();
                parameters.Add("p_id", obj.id, ParameterDirection.Input);
                parameters.Add("p_userid", obj.userid, ParameterDirection.Input);
                parameters.Add("p_usertypeid", obj.usertypeid, ParameterDirection.Input);
                parameters.Add("p_firstname", obj.firstname, ParameterDirection.Input);
                parameters.Add("p_lastname", obj.lastname, ParameterDirection.Input);
                parameters.Add("p_emailid", obj.emailid, ParameterDirection.Input);
                parameters.Add("p_mobile", obj.mobile, ParameterDirection.Input);
                parameters.Add("p_isenabled", obj.isenabled, ParameterDirection.Input);
                parameters.Add("p_islockedout", obj.islockedout, ParameterDirection.Input);
                using (reader = db.GetReader(conn, CommandType.StoredProcedure, Constants.StoredProcedures.ussp_user, parameters))
                {
                    dt = db.Load(reader, true);
                }
                return(CommonUtility.ToList <user>(dt));
            }
            catch (MySqlException odbcEx)
            {
                throw odbcEx;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally { db.CloseConnection(conn); }
        }
Esempio n. 3
0
        public List <seat> GetSeats(seat objseat)
        {
            MySqlDatabaseFactory db         = new MySqlDatabaseFactory();
            Parameters           parameters = new Parameters();
            MySqlDataReader      reader     = null;
            MySqlConnection      conn       = db.GetDatabaseConnection();

            try
            {
                DataTable dt = new DataTable();
                parameters.Add("p_seatid", objseat.seatid, ParameterDirection.Input);
                parameters.Add("p_floorid", objseat.floorid, ParameterDirection.Input);
                parameters.Add("p_seatlabel", objseat.seatlabel, ParameterDirection.Input);
                parameters.Add("p_booked", objseat.isbooked, ParameterDirection.Input);
                using (reader = db.GetReader(conn, CommandType.StoredProcedure, Constants.StoredProcedures.ussp_seat, parameters))
                {
                    dt = db.Load(reader, true);
                }
                return(CommonUtility.ToList <seat>(dt));
            }
            catch (MySqlException odbcEx)
            {
                throw odbcEx;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally { db.CloseConnection(conn); }
        }
Esempio n. 4
0
        public List <buildingfloor> Getfloors(buildingfloor objbuildingfloor)
        {
            MySqlDatabaseFactory db         = new MySqlDatabaseFactory();
            Parameters           parameters = new Parameters();
            MySqlDataReader      reader     = null;
            MySqlConnection      conn       = db.GetDatabaseConnection();

            try
            {
                DataTable dt = new DataTable();
                parameters.Add("p_floorid", objbuildingfloor.floorid, ParameterDirection.Input);
                parameters.Add("p_floorname", objbuildingfloor.floorname, ParameterDirection.Input);
                parameters.Add("p_buildingname", objbuildingfloor.buildingname, ParameterDirection.Input);
                parameters.Add("p_isactive", objbuildingfloor.isactive, ParameterDirection.Input);
                using (reader = db.GetReader(conn, CommandType.StoredProcedure, Constants.StoredProcedures.ussp_floor, parameters))
                {
                    dt = db.Load(reader, true);
                }
                return(CommonUtility.ToList <buildingfloor>(dt));
            }
            catch (MySqlException odbcEx)
            {
                throw odbcEx;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally { db.CloseConnection(conn); }
        }
Esempio n. 5
0
        public dashboard GetDashboard(string floorid)
        {
            MySqlDatabaseFactory db         = new MySqlDatabaseFactory();
            Parameters           parameters = new Parameters();
            MySqlDataReader      reader     = null;
            MySqlConnection      conn       = db.GetDatabaseConnection();

            try
            {
                DataTable dt = new DataTable();
                parameters.Add("p_floorid", floorid, ParameterDirection.Input);
                using (reader = db.GetReader(conn, CommandType.StoredProcedure, Constants.StoredProcedures.ussp_dashboard, parameters))
                {
                    dt = db.Load(reader, true);
                }
                return(CommonUtility.ToList <dashboard>(dt).FirstOrDefault());
            }
            catch (MySqlException odbcEx)
            {
                throw odbcEx;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally { db.CloseConnection(conn); }
        }