public List <T> Query <T>() { log.Action = "Query"; log.Message = "Select all data from Doctor table "; log.Date = DateTime.Now; log.Exception = ""; string sql = "Select * from Doctor"; using (var con = new SqlConnection(getConnString.getString())) { try { var output = con.Query <T>(sql).AsList(); //dirMsg.SendMessage(log); return(output); } catch (System.Exception ex) { //log.Exception = ex.ToString(); ////dirMsg.SendMessage(log); return(null); } } }
public List <T> Query <T>() { log.Action = "Query"; log.Message = "Select all data from Patient and Card table."; log.Date = DateTime.Now; log.Exception = ""; p.CardInfo = new Card(); using (var con = new SqlConnection(getConnString.getString())) { try { //Get Data var output = con.Query <T>("Select * from Patient p, Card c where p.PId=c.PId").AsList(); //dirMsg.SendMessage(log); return(output); } catch (System.Exception ex) { //log.Exception = ex.ToString(); //dirMsg.SendMessage(log); return(null); } } }
public List <T> GetLogData <T>() { using (var con = new SqlConnection(getConnString.getString())) { string sql = "Select * from Log"; var output = con.Query <T>(sql).AsList(); return(output); } }
//public List<T> GetLogData<T>() //{ // using (var con = new SqlConnection(getConnString.getString())) // { // string sql = "Select * from Log"; // var output = con.Query<T>(sql).AsList(); // return output; // } //} public int AddLogInfo(DateTime date, string action, string msg, string ex) { Log log = new Log(); log.Action = action; log.Message = msg; log.Date = date; log.Exception = ex; using (var con = new SqlConnection(getConnString.getString())) { string sql = "Insert into Log(Date, Action, Message, Exception) values(@Date, @Action, @Message, @Exception)"; // Add Log var chk = con.Execute(sql, log); return(chk); } }
public List <Fee> GetDocFee(int id) { string sql = "Select * from Fee where DId = @DId"; using (var con = new SqlConnection(getConnString.getString())) { try { var output = con.Query <Fee>(sql, new { @DId = id }).AsList(); return(output); } catch (System.Exception ex) { return(null); } } }