public static bool GetIsFileUpload(int DeviceID) { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Atten_Device> Atten_DeviceCollection = new CustomList <Atten_Device>(); IDataReader reader = null; Atten_Device newAtten_Device = null; String sql = "Select * From Atten_Device Where id=" + DeviceID + " "; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { newAtten_Device = new Atten_Device(); newAtten_Device.SetData(reader); } return(newAtten_Device._IsFileUpload); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public static CustomList <Atten_Device> GetAllAtten_DeviceSQL() { ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Atten_Device> Atten_DeviceCollection = new CustomList <Atten_Device>(); IDataReader reader = null; const String sql = "Select * From Atten_Device WHERE Extension='sql'"; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { Atten_Device newAtten_Device = new Atten_Device(); newAtten_Device.SetData(reader); Atten_DeviceCollection.Add(newAtten_Device); } return(Atten_DeviceCollection); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }
public ListItem DefaultListItem() { ListItem li = new ListItem(); //return li; ConnectionManager conManager = new ConnectionManager(ConnectionName.HR); CustomList <Atten_Device> Atten_DeviceCollection = new CustomList <Atten_Device>(); IDataReader reader = null; Atten_Device newAtten_Device = null; String sql = "Select * From Atten_Device Where id=" + 3 + " "; try { conManager.OpenDataReader(sql, out reader); while (reader.Read()) { newAtten_Device = new Atten_Device(); newAtten_Device.SetData(reader); } li.Text = newAtten_Device._DeviceName; li.Value = newAtten_Device._id.ToString(); return(li); } catch (Exception ex) { throw (ex); } finally { if (reader != null && !reader.IsClosed) { reader.Close(); } } }