protected void getTaskStatus() { List <taskstatus> lstTaskStatus = new List <taskstatus>(); taskstatusBus oTaskStatus = new taskstatusBus(); lstTaskStatus = oTaskStatus.taskstatusGetAll(); if (lstTaskStatus.Count > 0) { ddlTaskStatus.DataSource = lstTaskStatus; ddlTaskStatus.DataValueField = "taskStatusId"; ddlTaskStatus.DataTextField = "taskStatusDescription"; ddlTaskStatus.DataBind(); } }
protected void generateBarChartTasks() { DataTable dttTaskByStatus = new DataTable(); dttTaskByStatus.Columns.Add(new DataColumn("statusId", System.Type.GetType("System.Int32"))); dttTaskByStatus.Columns.Add(new DataColumn("StatusName", System.Type.GetType("System.String"))); dttTaskByStatus.Columns.Add(new DataColumn("Quantity", System.Type.GetType("System.Int32"))); List <taskstatus> lstTaskStatus = new List <taskstatus>(); taskstatusBus oTaskStatus = new taskstatusBus(); List <tasks> lstTasks = new List <tasks>(); tasksBus oTask = new tasksBus(); lstTaskStatus = oTaskStatus.taskstatusGetAll(); if (lstTaskStatus.Count > 0) { foreach (taskstatus rowTaskStatus in lstTaskStatus) { int qtyTask = 0; lstTasks = oTask.tasksGetAll(); foreach (tasks rowTask in lstTasks) { if (rowTask.TaskStatudId == rowTaskStatus.TaskStatusId) { if (rowTask.TaskStatudId != 2) //Closed { if (rowTask.TaskStatudId != 5) //Rejected { qtyTask++; } } } } dttTaskByStatus.Rows.Add(rowTaskStatus.TaskStatusId, rowTaskStatus.TaskStatusDescription, qtyTask); } } barChartTasks.Series[0].XValueMember = "StatusName"; barChartTasks.Series[0].YValueMembers = "Quantity"; barChartTasks.DataSource = dttTaskByStatus; barChartTasks.DataBind(); }