protected void Page_Load(object sender, EventArgs e) { ((Pop)this.Master).Width = 450; TicketID = QS("tid", 0); _ticketEntity = ticketApp.GetTickets(TicketID); if (!IsPostBack) { if (_ticketEntity != null) { litHead.Text = "Ticket ID: " + _ticketEntity.TicketID + ", " + _ticketEntity.Title; if (_ticketEntity.Status == TicketsState.Waiting_Confirm) { ltrlFinalTime.Text = _ticketEntity.FinalTime.ToString() + " hour(s)"; } ddlClient.DataSource = projApp.GetPojectClientUsers(_ticketEntity.ProjectID, projApp.Get(_ticketEntity.ProjectID).CompanyID); ddlClient.DataBind(); ListItem li = ddlClient.Items.FindByValue(_ticketEntity.ConfirmEstmateUserId.ToString()); if (li != null) { li.Selected = true; } } } }
private void SetEditClient(TicketUsersEntity ticketUsersEntity) { if (ticketsEntity.IsInternal == true) { dvClient.Visible = false; } else { List <UsersEntity> clientUsers = projApp.GetPojectClientUsers(ticketsEntity.ProjectID, projApp.Get(ticketsEntity.ProjectID).CompanyID); ddlClient.DataSource = clientUsers; ddlClient.DataBind(); clientUsers.BindDropdown(ddlClient, UserNameDisplayProp, "UserID", "Please select...", "-1"); if (null == ticketUsersEntity || userApp.GetUser(ticketUsersEntity.UserID).Role != RolesEnum.CLIENT) { ddlClient.SelectedValue = "-1"; } else { ddlClient.SelectedValue = ticketUsersEntity.UserID.ToString(); } //找一下ticket的createuser是不是Client //如果是则选中这个client //否则选择please select dvClient.Visible = true; } }
public void ProcessRequest(HttpContext context) { HttpResponse response = context.Response; HttpRequest request = context.Request; int projectID = QS(request.QueryString["projectID"], 0); if (projectID != 0) { ProjectApplication projectApplication = new ProjectApplication(); List <UsersEntity> clientUsers = projectApplication.GetPojectClientUsers(projectID, projectApplication.Get(projectID).CompanyID); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("["); foreach (UsersEntity user in clientUsers) { stringBuilder.Append("{"); stringBuilder.AppendFormat("\"name\":\"{0}\",\"value\":\"{1}\"", user.FirstAndLastName, user.UserID); stringBuilder.Append("},"); } response.Write(stringBuilder.ToString().TrimEnd(',') + "]"); } }