public void UpdateReport(int ID, string BT, int TP, string TDesc, DateTime TDate, DateTime RDate, int Age) { ReportEntry re = new ReportEntry(); re.ID = ID; re.BT = BT; re.TP = TP; re.TDesc = TDesc; re.TDate = TDate; re.RDate = RDate; re.Age = Age; re.UpdateReport(re); }
public DataSet SearchID(int ID) { ReportEntry re = new ReportEntry(); string query = "Select * from ReportEntry where UserID ='" + ID + "'"; MyCon.Open(); ds = new DataSet(); adapter = new SqlDataAdapter(query, MyCon); adapter.Fill(ds); MyCon.Close(); return(ds); }
public void RegisterReportEntry(ReportEntry RE) { string query = "RegisterReports"; SqlCommand cmd = new SqlCommand(query, MyCon); MyCon.Open(); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", RE.ID); cmd.Parameters.AddWithValue("@BT", RE.BT); cmd.Parameters.AddWithValue("@TP", RE.TP); cmd.Parameters.AddWithValue("@TD", RE.TDesc); cmd.Parameters.AddWithValue("@DOT", RE.TDate.Date.ToString()); cmd.Parameters.AddWithValue("@DOR", RE.RDate.Date.ToString()); cmd.Parameters.AddWithValue("@Age", RE.Age); cmd.ExecuteNonQuery(); MyCon.Close(); }
public void UpdateReport(ReportEntry R) { string query = "UpdateingReports"; MyCon.Open(); SqlCommand cmd = new SqlCommand(query, MyCon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID", R.ID); cmd.Parameters.AddWithValue("@BT", R.BT); cmd.Parameters.AddWithValue("@TP", R.TP); cmd.Parameters.AddWithValue("@TD", R.TDesc); cmd.Parameters.AddWithValue("@DT", R.TDate); cmd.Parameters.AddWithValue("@DR", R.RDate); cmd.Parameters.AddWithValue("@Age", R.Age); cmd.ExecuteNonQuery(); MyCon.Close(); }
public ReportEntry GetReportByID(int id) { ReportEntry re = new ReportEntry(); string query = "Select * from ReportEntry where UserID ='" + id + "'"; MyCon.Open(); SqlCommand cmd = new SqlCommand(query, MyCon); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { re.ID = int.Parse(reader[0].ToString()); re.BT = reader[1].ToString(); re.TP = int.Parse(reader[2].ToString()); re.TDesc = reader[3].ToString(); re.TDate = Convert.ToDateTime(reader[4].ToString()); re.RDate = Convert.ToDateTime(reader[5].ToString()); re.Age = int.Parse(reader[6].ToString()); } MyCon.Close(); return(re); }
public ReportEntry GetReportByID(int ID) { ReportEntry re = new ReportEntry(); return(re.GetReportByID(ID)); }
public DataSet SearchID(int ID) { ReportEntry re = new ReportEntry(); return(re.SearchID(ID)); }
public DataSet GetReports() { ReportEntry re = new ReportEntry(); return(re.GetAllReports()); }