protected void uiGridViewStudentsAbsence_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditReports") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentAttendanceReport = id; DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetMonthlyAttendanceReport(id); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxDay.Text = string.Format("{0:dd/MM/yyyy}", DateTime.Parse(ds.Tables[0].Rows[0]["Date"].ToString())); } uiPanelCurrentStudents.Visible = false; uiPanelCurrent.Visible = true; } else if (e.CommandName == "DeleteReports") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentAttendanceReport = id; DBLayer db = new DBLayer(); db.DeleteMonthlyAttendanceReport(id); uiPanelCurrentStudents.Visible = false; uiPanelCurrent.Visible = true; BindData(); } }