private List <BangKeDto> GetAllBangKeDtos() { var bangKeDtos = new List <BangKeDto>(); foreach (GridViewRow row in gvBangKe.Rows) { if (row.RowType == DataControlRowType.DataRow) { CheckBox chkRow = (row.Cells[0].FindControl("chkRow") as CheckBox); var bangKeDto = new BangKeDto(); bangKeDto.UserName = row.Cells[3].Text; bangKeDto.Thang = row.Cells[10].Text; bangKeDto.IsPaid = chkRow.Checked ? 1 : -1; bangKeDtos.Add(bangKeDto); } } return(bangKeDtos); }
private bool GetAllBangKeDto(out BangKeDto[] allBangKeDto) { var userName = UserName.Value.Trim(); var idMember = IdMember.Value.Trim(); var sBeginDate = BeginDate.Value.Trim(); var beginDate = DateUtil.GetDateTime(sBeginDate); var sEndDate = EndDate.Value.Trim(); var endDate = DateUtil.GetDateTime(sEndDate); if (!IsValidSearchCondition(idMember, sBeginDate, sEndDate)) { allBangKeDto = new BangKeDto[0]; return(false); } if (endDate == null) { endDate = DateTime.Now; } allBangKeDto = DcapServiceUtil.SearchBangKeExt(idMember, userName, beginDate, endDate); return(true); }