public List<UserTransactionReport> GetWorkshopsPurchased(int ProductID) { DB db = new DB(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "GetWorkshopsPurchasedByProduct"; cmd.Parameters.AddWithValue("@ProductID", ProductID); List<UserTransactionReport> Students = new List<UserTransactionReport>(); DataTable dt = db.Execute(cmd); foreach (DataRow dr in dt.Rows) { UserTransactionReport Student = new UserTransactionReport { Email = dr["Email"].ToString(), ProductID = Int32.Parse(dr["ProductID"].ToString()), ProductName = dr["ProductName"].ToString(), OrderDate = DateTime.Parse(dr["OrderDate"].ToString()), Status = dr["Status"].ToString(), FullName = dr["FullName"].ToString(), Amount = Decimal.Parse(dr["Amount"].ToString()), Phone = dr["Phone"].ToString(), Location = dr["Location"].ToString(), }; Students.Add(Student); } return Students; }
public List<UserTransactionReport> GetCMEDSummerClassesStudentsReport() { DB db = new DB(); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "GetCMEDSummerClassesStudentsReport"; List<UserTransactionReport> Students = new List<UserTransactionReport>(); DataTable dt = db.Execute(cmd); foreach (DataRow dr in dt.Rows) { UserTransactionReport Student = new UserTransactionReport { Email = dr["Email"].ToString(), ProductID = Int32.Parse(dr["ProductID"].ToString()), ProductName = dr["ProductName"].ToString(), OrderDate = DateTime.Parse(dr["OrderDate"].ToString()), Status = dr["Status"].ToString(), FullName = dr["FullName"].ToString(), Amount = Decimal.Parse(dr["Amount"].ToString()), Phone = dr["Phone"].ToString(), }; Students.Add(Student); } return Students; }