コード例 #1
0
    /// <summary>
    /// Fills up taskIdDropDownList DDL
    /// </summary>
    private void FillTaskIdDropDownList()
    {
        try
        {
            string      employeeId        = Session["userID"].ToString();
            TaskGateway TaskGatewayObject = new TaskGateway();
            taskIdDropDownList.DataSource     = TaskGatewayObject.GetAllOpenTasksOfAUser(employeeId);
            taskIdDropDownList.DataTextField  = "Id";
            taskIdDropDownList.DataValueField = "Id";
            taskIdDropDownList.DataBind();

            if (TaskGatewayObject.GetAllOpenTasksOfAUser(employeeId).Count == 0)
            {
                errorLabel.Text = "Admin don't have any task in hand right now. Other employee is working on it. Cant edit task information now.";
            }
        }
        catch (SqlException sqlExceptionObj)
        {
            errorLabel.Text = sqlExceptionObj.Message;
        }
        catch (Exception exceptionObj)
        {
            errorLabel.Text = exceptionObj.Message;
        }
    }
コード例 #2
0
 /// <summary>
 /// Fills up tasksOfUserBulletedList DDL
 /// </summary>
 private void FillTaskOfUser()
 {
     try
     {
         TaskGateway TaskGatewayObj = new TaskGateway();
         numberOfTasksLabel.Text                = TaskGatewayObj.GetAllOpenTasksOfAUser(employeeId).Count + " task(s) " + " \nAssigened to this employee  \n";
         tasksOfUserBulletedList.DataSource     = TaskGatewayObj.GetAllOpenTasksOfAUser(employeeId);
         tasksOfUserBulletedList.DataTextField  = "Name";
         tasksOfUserBulletedList.DataValueField = "ID";
         tasksOfUserBulletedList.DataBind();
     }
     catch (SqlException sqlExceptionObj)
     {
         errorLabel.Text = sqlExceptionObj.Message;
     }
     catch (Exception exceptionObj)
     {
         errorLabel.Text = exceptionObj.Message;
     }
 }